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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 Vector<ImageResource*> images; 358 Vector<ImageResource*> images;
359 appendImagesFromStyle(images, *newStyle); 359 appendImagesFromStyle(images, *newStyle);
360 if (images.isEmpty()) 360 if (images.isEmpty())
361 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); 361 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this);
362 else 362 else
363 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); 363 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this);
364 } 364 }
365 365
366 void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo ntainer) 366 void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo ntainer)
367 { 367 {
368 if (!shouldCheckForInvalidationAfterLayout()) 368 // Note, we don't want to early out here using shouldCheckForInvalidationAft erLayout as
369 return; 369 // we have to make sure we go through any positioned objects as they won't b e seen in
370 // the normal tree walk.
370 371
371 RenderBox::repaintTreeAfterLayout(repaintContainer); 372 if (shouldCheckForInvalidationAfterLayout())
373 RenderBox::repaintTreeAfterLayout(repaintContainer);
372 374
373 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. 375 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
374 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { 376 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) {
375 TrackedRendererListHashSet::iterator end = positionedObjects->end(); 377 TrackedRendererListHashSet::iterator end = positionedObjects->end();
376 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); 378 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset());
377 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { 379 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) {
378 RenderBox* box = *it; 380 RenderBox* box = *it;
379 381
380 // One of the renderers we're skipping over here may be the child's repaint container, 382 // One of the renderers we're skipping over here may be the child's repaint container,
381 // so we can't pass our own repaint container along. 383 // so we can't pass our own repaint container along.
382 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint(); 384 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint();
383 385
386 // When a floating object is moved the children do not get layout bu t they get a new position.
387 // We have to make sure we invalidate the children if a floating par ent container moves.
388 if (isFloating() || isRelPositioned()) {
Julien - ping for review 2014/05/27 12:34:53 Note that this is independent of the child so we c
dsinclair 2014/05/27 15:37:13 Done.
389 if (box->previousPositionFromRepaintContainer() != box->position FromRepaintContainer(&repaintContainerForChild)) {
390 // Note, this has to be non-recursive. If we walk up the tre e we'll end up setting
391 // the flag on our parent who has already cleared their flag s for this invalidation
392 // walk. We also don't have to force them to walk as we're a ll ready there.
Julien - ping for review 2014/05/27 12:34:53 all ready, not already?
dsinclair 2014/05/27 15:37:13 Done.
393 box->setMayNeedInvalidationNonRecursive(true);
394 }
395 }
396
384 // If the positioned renderer is absolutely positioned and it is ins ide 397 // If the positioned renderer is absolutely positioned and it is ins ide
385 // a relatively positioend inline element, we need to account for 398 // a relatively positioend inline element, we need to account for
386 // the inline elements position in LayoutState. 399 // the inline elements position in LayoutState.
387 if (box->style()->position() == AbsolutePosition) { 400 if (box->style()->position() == AbsolutePosition) {
388 RenderObject* container = box->container(&repaintContainerForChi ld, 0); 401 RenderObject* container = box->container(&repaintContainerForChi ld, 0);
389 if (container->isInFlowPositioned() && container->isRenderInline ()) { 402 if (container->isInFlowPositioned() && container->isRenderInline ()) {
390 // FIXME: We should be able to use layout-state for this. 403 // FIXME: We should be able to use layout-state for this.
391 // Currently, we will place absolutly positioned elements in side 404 // Currently, we will place absolutly positioned elements in side
392 // relatively positioned inline blocks in the wrong location . crbug.com/371485 405 // relatively positioned inline blocks in the wrong location . crbug.com/371485
393 LayoutStateDisabler disable(*this); 406 LayoutStateDisabler disable(*this);
(...skipping 4623 matching lines...) Expand 10 before | Expand all | Expand 10 after
5017 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5030 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5018 { 5031 {
5019 showRenderObject(); 5032 showRenderObject();
5020 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5033 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5021 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5034 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5022 } 5035 }
5023 5036
5024 #endif 5037 #endif
5025 5038
5026 } // namespace WebCore 5039 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698