Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 1934833002: Ensure filter and reflection outsets are applied on paint invalidation rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 } 1076 }
1077 } 1077 }
1078 return overflowRect; 1078 return overflowRect;
1079 } 1079 }
1080 1080
1081 bool LayoutInline::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* an cestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const 1081 bool LayoutInline::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* an cestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const
1082 { 1082 {
1083 if (ancestor == this) 1083 if (ancestor == this)
1084 return true; 1084 return true;
1085 1085
1086 bool ancestorSkipped; 1086 LayoutObject* container = this->container();
1087 LayoutObject* container = this->container(ancestor, &ancestorSkipped); 1087 ASSERT(container == parent());
1088 if (!container) 1088 if (!container)
1089 return true; 1089 return true;
1090 1090
1091 LayoutPoint topLeft = rect.location(); 1091 LayoutPoint topLeft = rect.location();
1092 1092
1093 if (style()->hasInFlowPosition() && layer()) { 1093 if (style()->hasInFlowPosition() && layer()) {
1094 // Apply the in-flow position offset when invalidating a rectangle. The layer 1094 // Apply the in-flow position offset when invalidating a rectangle. The layer
1095 // is translated, but the layout box isn't, so we need to do this to get the 1095 // is translated, but the layout box isn't, so we need to do this to get the
1096 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position 1096 // right dirty rect. Since this is called from LayoutObject::setStyle, t he relative position
1097 // flag on the LayoutObject has been cleared, so use the one on the styl e(). 1097 // flag on the LayoutObject has been cleared, so use the one on the styl e().
1098 topLeft += layer()->offsetForInFlowPosition(); 1098 topLeft += layer()->offsetForInFlowPosition();
1099 } 1099 }
1100 1100
1101 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout, 1101 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout,
1102 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer. 1102 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer.
1103 rect.setLocation(topLeft); 1103 rect.setLocation(topLeft);
1104 1104
1105 if (container->isBox() && !toLayoutBox(container)->mapScrollingContentsRectT oBoxSpace(rect, container == ancestor ? ApplyNonScrollOverflowClip : ApplyOverfl owClip, visualRectFlags)) 1105 if (container->isBox() && !toLayoutBox(container)->mapScrollingContentsRectT oBoxSpace(rect, container == ancestor ? ApplyNonScrollOverflowClip : ApplyOverfl owClip, visualRectFlags))
1106 return false; 1106 return false;
1107 1107
1108 if (ancestorSkipped) {
1109 // If the paintInvalidationContainer is below o, then we need to map the rect into paintInvalidationContainer's coordinates.
1110 LayoutSize containerOffset = ancestor->offsetFromAncestorContainer(conta iner);
1111 rect.move(-containerOffset);
1112 return true;
1113 }
1114
1115 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectF lags); 1108 return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectF lags);
1116 } 1109 }
1117 1110
1118 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons t 1111 LayoutSize LayoutInline::offsetFromContainer(const LayoutObject* container) cons t
1119 { 1112 {
1120 ASSERT(container == this->container()); 1113 ASSERT(container == this->container());
1121 1114
1122 LayoutSize offset; 1115 LayoutSize offset;
1123 if (isInFlowPositioned()) 1116 if (isInFlowPositioned())
1124 offset += offsetForInFlowPosition(); 1117 offset += offsetForInFlowPosition();
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 1359
1367 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const 1360 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const
1368 { 1361 {
1369 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason); 1362 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason);
1370 1363
1371 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1364 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1372 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1365 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1373 } 1366 }
1374 1367
1375 } // namespace blink 1368 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698