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

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

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, Fix break Created 6 years, 8 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 RenderBox::willBeDestroyed(); 279 RenderBox::willBeDestroyed();
280 } 280 }
281 281
282 void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt yle) 282 void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt yle)
283 { 283 {
284 RenderStyle* oldStyle = style(); 284 RenderStyle* oldStyle = style();
285 285
286 setReplaced(newStyle.isDisplayInlineType()); 286 setReplaced(newStyle.isDisplayInlineType());
287 287
288 if (oldStyle && parent() && diff == StyleDifferenceLayout && oldStyle->posit ion() != newStyle.position()) { 288 if (oldStyle && parent() && diff.needsFullLayout() && oldStyle->position() ! = newStyle.position()) {
289 if (newStyle.position() == StaticPosition) 289 if (newStyle.position() == StaticPosition)
290 // Clear our positioned objects list. Our absolutely positioned desc endants will be 290 // Clear our positioned objects list. Our absolutely positioned desc endants will be
291 // inserted into our containing block's positioned objects list duri ng layout. 291 // inserted into our containing block's positioned objects list duri ng layout.
292 removePositionedObjects(0, NewContainingBlock); 292 removePositionedObjects(0, NewContainingBlock);
293 else if (oldStyle->position() == StaticPosition) { 293 else if (oldStyle->position() == StaticPosition) {
294 // Remove our absolutely positioned descendants from their current c ontaining block. 294 // Remove our absolutely positioned descendants from their current c ontaining block.
295 // They will be inserted into our positioned objects list during lay out. 295 // They will be inserted into our positioned objects list during lay out.
296 RenderObject* cb = parent(); 296 RenderObject* cb = parent();
297 while (cb && (cb->style()->position() == StaticPosition || (cb->isIn line() && !cb->isReplaced())) && !cb->isRenderView()) { 297 while (cb && (cb->style()->position() == StaticPosition || (cb->isIn line() && !cb->isReplaced())) && !cb->isRenderView()) {
298 if (cb->style()->position() == RelativePosition && cb->isInline( ) && !cb->isReplaced()) { 298 if (cb->style()->position() == RelativePosition && cb->isInline( ) && !cb->isReplaced()) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 342
343 if (FastTextAutosizer* textAutosizer = document().fastTextAutosizer()) 343 if (FastTextAutosizer* textAutosizer = document().fastTextAutosizer())
344 textAutosizer->record(this); 344 textAutosizer->record(this);
345 345
346 propagateStyleToAnonymousChildren(true); 346 propagateStyleToAnonymousChildren(true);
347 invalidateLineHeight(); 347 invalidateLineHeight();
348 348
349 // It's possible for our border/padding to change, but for the overall logic al width of the block to 349 // It's possible for our border/padding to change, but for the overall logic al width of the block to
350 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true. 350 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
351 m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff == StyleDifferenc eLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyl e); 351 m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle);
352 352
353 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that 353 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that
354 // network priorities can be set. 354 // network priorities can be set.
355 Vector<ImageResource*> images; 355 Vector<ImageResource*> images;
356 appendImagesFromStyle(images, *newStyle); 356 appendImagesFromStyle(images, *newStyle);
357 if (images.isEmpty()) 357 if (images.isEmpty())
358 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); 358 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this);
359 else 359 else
360 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); 360 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this);
361 } 361 }
(...skipping 4505 matching lines...) Expand 10 before | Expand all | Expand 10 after
4867 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 4867 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
4868 { 4868 {
4869 showRenderObject(); 4869 showRenderObject();
4870 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 4870 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
4871 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 4871 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
4872 } 4872 }
4873 4873
4874 #endif 4874 #endif
4875 4875
4876 } // namespace WebCore 4876 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/SimplifyMarkupCommand.cpp ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698