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

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 662483002: Ensure positioned descendants are invalidated if needed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that 368 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that
369 // network priorities can be set. 369 // network priorities can be set.
370 Vector<ImageResource*> images; 370 Vector<ImageResource*> images;
371 appendImagesFromStyle(images, *newStyle); 371 appendImagesFromStyle(images, *newStyle);
372 if (images.isEmpty()) 372 if (images.isEmpty())
373 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); 373 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this);
374 else 374 else
375 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); 375 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this);
376 } 376 }
377 377
378 void RenderBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintInva lidationState) 378 void RenderBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState & childPaintInvalidationState)
379 { 379 {
380 // Note, we don't want to early out here using shouldCheckForInvalidationAft erLayout as 380 RenderBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState);
381 // we have to make sure we go through any positioned objects as they won't b e seen in
dsinclair 2014/10/16 13:32:37 Since we no longer override invalidateTreeIfNeeded
Xianzhu 2014/10/16 17:37:14 The previous logic walks 1 extra level into the po
382 // the normal tree walk.
383
384 RenderBox::invalidateTreeIfNeeded(paintInvalidationState);
385 381
386 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect. 382 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect.
387 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { 383 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) {
388 TrackedRendererListHashSet::iterator end = positionedObjects->end(); 384 TrackedRendererListHashSet::iterator end = positionedObjects->end();
389 bool establishesNewPaintInvalidationContainer = isPaintInvalidationConta iner();
390 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCom positedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? t his : &paintInvalidationState.paintInvalidationContainer());
391 PaintInvalidationState childPaintInvalidationState(paintInvalidationStat e, *this, newPaintInvalidationContainer);
392 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { 385 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) {
393 RenderBox* box = *it; 386 RenderBox* box = *it;
394 387
395 // One of the renderers we're skipping over here may be the child's paint invalidation container, 388 // One of the renderers we're skipping over here may be the child's paint invalidation container,
396 // so we can't pass our own paint invalidation container along. 389 // so we can't pass our own paint invalidation container along.
397 const RenderLayerModelObject& paintInvalidationContainerForChild = * box->containerForPaintInvalidation(); 390 const RenderLayerModelObject& paintInvalidationContainerForChild = * box->containerForPaintInvalidation();
398 391
399 // If it's a new paint invalidation container, we won't have properl y accumulated the offset into the 392 // If it's a new paint invalidation container, we won't have properl y accumulated the offset into the
400 // PaintInvalidationState. 393 // PaintInvalidationState.
401 // FIXME: Teach PaintInvalidationState to handle this case. crbug.co m/371485 394 // FIXME: Teach PaintInvalidationState to handle this case. crbug.co m/371485
402 if (&paintInvalidationContainerForChild != newPaintInvalidationConta iner) { 395 if (paintInvalidationContainerForChild != childPaintInvalidationStat e.paintInvalidationContainer()) {
403 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalida tionState); 396 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalida tionState);
404 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild); 397 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild);
405 box->invalidateTreeIfNeeded(disabledPaintInvalidationState); 398 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
406 continue; 399 continue;
407 } 400 }
408 401
409 // If the positioned renderer is absolutely positioned and it is ins ide 402 // If the positioned renderer is absolutely positioned and it is ins ide
410 // a relatively positioned inline element, we need to account for 403 // a relatively positioned inline element, we need to account for
411 // the inline elements position in PaintInvalidationState. 404 // the inline elements position in PaintInvalidationState.
412 if (box->style()->position() == AbsolutePosition) { 405 if (box->style()->position() == AbsolutePosition) {
(...skipping 3943 matching lines...) Expand 10 before | Expand all | Expand 10 after
4356 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 4349 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
4357 { 4350 {
4358 showRenderObject(); 4351 showRenderObject();
4359 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 4352 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
4360 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 4353 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
4361 } 4354 }
4362 4355
4363 #endif 4356 #endif
4364 4357
4365 } // namespace blink 4358 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698