| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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() && n
eedsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle); |
| 371 | 371 |
| 372 // If the style has unloaded images, want to notify the ResourceLoadPriority
Optimizer so that | 372 // If the style has unloaded images, want to notify the ResourceLoadPriority
Optimizer so that |
| 373 // network priorities can be set. | 373 // network priorities can be set. |
| 374 Vector<ImageResource*> images; | 374 Vector<ImageResource*> images; |
| 375 appendImagesFromStyle(images, *newStyle); | 375 appendImagesFromStyle(images, *newStyle); |
| 376 if (images.isEmpty()) | 376 if (images.isEmpty()) |
| 377 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe
nderObject(this); | 377 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe
nderObject(this); |
| 378 else | 378 else |
| 379 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende
rObject(this); | 379 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende
rObject(this); |
| 380 } | 380 } |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 } | 1427 } |
| 1428 | 1428 |
| 1429 for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end(
); it != end; ++it) | 1429 for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end(
); it != end; ++it) |
| 1430 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyIm
ageResourceVisibility(*it, status, screenArea); | 1430 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyIm
ageResourceVisibility(*it, status, screenArea); |
| 1431 | 1431 |
| 1432 return true; | 1432 return true; |
| 1433 } | 1433 } |
| 1434 | 1434 |
| 1435 bool RenderBlock::widthAvailableToChildrenHasChanged() | 1435 bool RenderBlock::widthAvailableToChildrenHasChanged() |
| 1436 { | 1436 { |
| 1437 bool widthAvailableToChildrenHasChanged = m_hasBorderOrPaddingLogicalWidthCh
anged; | 1437 bool widthAvailableToChildrenHasChanged = m_widthAvailableToChildrenChanged; |
| 1438 m_hasBorderOrPaddingLogicalWidthChanged = false; | 1438 m_widthAvailableToChildrenChanged = false; |
| 1439 | 1439 |
| 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 | 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 |
| 1441 // though our own width has remained the same. | 1441 // though our own width has remained the same. |
| 1442 widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX &&
needsPreferredWidthsRecalculation() && view()->layoutState()->containingBlockLog
icalWidthChanged(); | 1442 widthAvailableToChildrenHasChanged |= style()->boxSizing() == BORDER_BOX &&
needsPreferredWidthsRecalculation() && view()->layoutState()->containingBlockLog
icalWidthChanged(); |
| 1443 | 1443 |
| 1444 return widthAvailableToChildrenHasChanged; | 1444 return widthAvailableToChildrenHasChanged; |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 bool RenderBlock::updateLogicalWidthAndColumnWidth() | 1447 bool RenderBlock::updateLogicalWidthAndColumnWidth() |
| 1448 { | 1448 { |
| (...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4410 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 4410 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 4411 { | 4411 { |
| 4412 showRenderObject(); | 4412 showRenderObject(); |
| 4413 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 4413 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 4414 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 4414 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 4415 } | 4415 } |
| 4416 | 4416 |
| 4417 #endif | 4417 #endif |
| 4418 | 4418 |
| 4419 } // namespace blink | 4419 } // namespace blink |
| OLD | NEW |