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

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: Rebase to master 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 RenderBox::repaintTreeAfterLayout(repaintContainer);
ojan 2014/05/24 05:14:29 Can this be: if (shouldCheckForInvalidationAfterL
dsinclair 2014/05/26 14:57:25 Done. I didn't bother before since the RenderBox v
372 373
373 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. 374 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
374 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { 375 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) {
375 TrackedRendererListHashSet::iterator end = positionedObjects->end(); 376 TrackedRendererListHashSet::iterator end = positionedObjects->end();
376 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); 377 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset());
377 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { 378 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) {
378 RenderBox* box = *it; 379 RenderBox* box = *it;
379 380
380 // One of the renderers we're skipping over here may be the child's repaint container, 381 // 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. 382 // so we can't pass our own repaint container along.
382 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint(); 383 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint();
383 384
385 // When a floating object is moved the children do not get layout bu t they get a new position.
386 // We have to make sure we invalidate the children if a floating par ent container moves.
387 if (isFloating() || isRelPositioned()) {
388 if (box->previousPositionFromRepaintContainer() != box->position FromRepaintContainer(&repaintContainerForChild)) {
389 // Note, this has to be non-recursive. If we walk up the tre e we'll end up setting
390 // the flag on our parent who has already cleared their flag s for this invalidation
391 // walk. We also don't have to force them to walk as we're a ll ready there.
392 box->setMayNeedInvalidationNonRecursive(true);
393 }
394 }
395
384 // If the positioned renderer is absolutely positioned and it is ins ide 396 // If the positioned renderer is absolutely positioned and it is ins ide
385 // a relatively positioend inline element, we need to account for 397 // a relatively positioend inline element, we need to account for
386 // the inline elements position in LayoutState. 398 // the inline elements position in LayoutState.
387 if (box->style()->position() == AbsolutePosition) { 399 if (box->style()->position() == AbsolutePosition) {
388 RenderObject* container = box->container(&repaintContainerForChi ld, 0); 400 RenderObject* container = box->container(&repaintContainerForChi ld, 0);
389 if (container->isInFlowPositioned() && container->isRenderInline ()) { 401 if (container->isInFlowPositioned() && container->isRenderInline ()) {
390 // FIXME: We should be able to use layout-state for this. 402 // FIXME: We should be able to use layout-state for this.
391 // Currently, we will place absolutly positioned elements in side 403 // Currently, we will place absolutly positioned elements in side
392 // relatively positioned inline blocks in the wrong location . crbug.com/371485 404 // relatively positioned inline blocks in the wrong location . crbug.com/371485
393 LayoutStateDisabler disable(*this); 405 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 5029 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5018 { 5030 {
5019 showRenderObject(); 5031 showRenderObject();
5020 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5032 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5021 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5033 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5022 } 5034 }
5023 5035
5024 #endif 5036 #endif
5025 5037
5026 } // namespace WebCore 5038 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698