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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 285103003: [RAL] Make sure RenderLayers are invalidated when moved. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test expectations for mac Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/repaint/crbug-371640-expected.txt ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index a95ad9ee2a5fb8d4cc81f71a43687feab0881aa4..5996b7b4811bb89f3ac5c95eaed51e1fbe3078fc 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -365,15 +365,19 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintContainer)
{
- if (!shouldCheckForInvalidationAfterLayout())
- return;
+ // Note, we don't want to early out here using shouldCheckForInvalidationAfterLayout as
+ // we have to make sure we go through any positioned objects as they won't be seen in
+ // the normal tree walk.
- RenderBox::repaintTreeAfterLayout(repaintContainer);
+ if (shouldCheckForInvalidationAfterLayout())
+ RenderBox::repaintTreeAfterLayout(repaintContainer);
// Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects()) {
TrackedRendererListHashSet::iterator end = positionedObjects->end();
LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset());
+
+ bool isFloatingOrRelPositioned = isFloating() || isRelPositioned();
leviw_travelin_and_unemployed 2014/05/27 17:27:57 Can this not be an issue with absPos as well? Can
for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(); it != end; ++it) {
RenderBox* box = *it;
@@ -381,6 +385,17 @@ void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo
// so we can't pass our own repaint container along.
const RenderLayerModelObject& repaintContainerForChild = *box->containerForRepaint();
+ // When a floating object is moved the children do not get layout but they get a new position.
+ // We have to make sure we invalidate the children if a floating parent container moves.
+ if (isFloatingOrRelPositioned) {
+ if (box->previousPositionFromRepaintContainer() != box->positionFromRepaintContainer(&repaintContainerForChild)) {
+ // Note, this has to be non-recursive. If we walk up the tree we'll end up setting
+ // the flag on our parent who has already cleared their flags for this invalidation
+ // walk. We also don't have to force them to walk as we're already there.
+ box->setSelfMayNeedInvalidation(true);
+ }
+ }
+
// If the positioned renderer is absolutely positioned and it is inside
// a relatively positioend inline element, we need to account for
// the inline elements position in LayoutState.
« no previous file with comments | « LayoutTests/fast/repaint/crbug-371640-expected.txt ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698