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

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

Issue 708283002: RLSA needsLayout on customscrollbar thickness change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed review comments Created 6 years, 1 month 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool m_hadHorizontalLayoutOverflow; 145 bool m_hadHorizontalLayoutOverflow;
146 bool m_hadVerticalLayoutOverflow; 146 bool m_hadVerticalLayoutOverflow;
147 }; 147 };
148 148
149 RenderBlock::RenderBlock(ContainerNode* node) 149 RenderBlock::RenderBlock(ContainerNode* node)
150 : RenderBox(node) 150 : RenderBox(node)
151 , m_hasMarginBeforeQuirk(false) 151 , m_hasMarginBeforeQuirk(false)
152 , m_hasMarginAfterQuirk(false) 152 , m_hasMarginAfterQuirk(false)
153 , m_beingDestroyed(false) 153 , m_beingDestroyed(false)
154 , m_hasMarkupTruncation(false) 154 , m_hasMarkupTruncation(false)
155 , m_hasBorderOrPaddingLogicalWidthChanged(false) 155 , m_widthAvailableToChildrenChanged(false)
156 , m_hasOnlySelfCollapsingChildren(false) 156 , m_hasOnlySelfCollapsingChildren(false)
157 , m_descendantsWithFloatsMarkedForLayout(false) 157 , m_descendantsWithFloatsMarkedForLayout(false)
158 { 158 {
159 // RenderBlockFlow calls setChildrenInline(true). 159 // RenderBlockFlow calls setChildrenInline(true).
160 // By default, subclasses do not have inline children. 160 // By default, subclasses do not have inline children.
161 } 161 }
162 162
163 void RenderBlock::trace(Visitor* visitor) 163 void RenderBlock::trace(Visitor* visitor)
164 { 164 {
165 visitor->trace(m_children); 165 visitor->trace(m_children);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 } 361 }
362 362
363 if (TextAutosizer* textAutosizer = document().textAutosizer()) 363 if (TextAutosizer* textAutosizer = document().textAutosizer())
364 textAutosizer->record(this); 364 textAutosizer->record(this);
365 365
366 propagateStyleToAnonymousChildren(true); 366 propagateStyleToAnonymousChildren(true);
367 367
368 // It's possible for our border/padding to change, but for the overall logic al width of the block to 368 // It's possible for our border/padding to change, but for the overall logic al width of the block to
369 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true. 369 // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
370 m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle); 370 m_widthAvailableToChildrenChanged = oldStyle && diff.needsFullLayout() && ne edsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle);
371
372 // Include CustomScrollbars to calculate width available to children changed .
373 m_widthAvailableToChildrenChanged |= needsLayout() && customScrollbarThickne ssChanged();
371 374
372 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that 375 // If the style has unloaded images, want to notify the ResourceLoadPriority Optimizer so that
373 // network priorities can be set. 376 // network priorities can be set.
374 Vector<ImageResource*> images; 377 Vector<ImageResource*> images;
375 appendImagesFromStyle(images, *newStyle); 378 appendImagesFromStyle(images, *newStyle);
376 if (images.isEmpty()) 379 if (images.isEmpty())
377 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); 380 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this);
378 else 381 else
379 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); 382 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this);
380 } 383 }
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 } 1430 }
1428 1431
1429 for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end( ); it != end; ++it) 1432 for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end( ); it != end; ++it)
1430 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyIm ageResourceVisibility(*it, status, screenArea); 1433 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyIm ageResourceVisibility(*it, status, screenArea);
1431 1434
1432 return true; 1435 return true;
1433 } 1436 }
1434 1437
1435 bool RenderBlock::widthAvailableToChildrenHasChanged() 1438 bool RenderBlock::widthAvailableToChildrenHasChanged()
1436 { 1439 {
1437 bool widthAvailableToChildrenHasChanged = m_hasBorderOrPaddingLogicalWidthCh anged; 1440 bool widthAvailableToChildrenHasChanged = m_widthAvailableToChildrenChanged;
1438 m_hasBorderOrPaddingLogicalWidthChanged = false; 1441 m_widthAvailableToChildrenChanged = false;
1442 setCustomScrollbarThicknessChanged(false);
1439 1443
1440 // If we use border-box sizing, have percentage padding, and our parent has changed width then the width available to our children has changed even 1444 // If we use border-box sizing, have percentage padding, and our parent has changed width then the width available to our children has changed even
1441 // though our own width has remained the same. 1445 // though our own width has remained the same.
1442 widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX && needsPreferredWidthsRecalculation() && view()->layoutState()->containingBlockLog icalWidthChanged(); 1446 widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX && needsPreferredWidthsRecalculation() && view()->layoutState()->containingBlockLog icalWidthChanged();
1443 1447
1444 return widthAvailableToChildrenHasChanged; 1448 return widthAvailableToChildrenHasChanged;
1445 } 1449 }
1446 1450
1447 bool RenderBlock::updateLogicalWidthAndColumnWidth() 1451 bool RenderBlock::updateLogicalWidthAndColumnWidth()
1448 { 1452 {
(...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4410 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 4414 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
4411 { 4415 {
4412 showRenderObject(); 4416 showRenderObject();
4413 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 4417 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
4414 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 4418 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
4415 } 4419 }
4416 4420
4417 #endif 4421 #endif
4418 4422
4419 } // namespace blink 4423 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698