| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 RenderBox::styleDidChange(diff, oldStyle); | 213 RenderBox::styleDidChange(diff, oldStyle); |
| 214 | 214 |
| 215 RenderStyle* newStyle = style(); | 215 RenderStyle* newStyle = style(); |
| 216 propagateStyleToAnonymousChildren(true); | 216 propagateStyleToAnonymousChildren(true); |
| 217 | 217 |
| 218 // It's possible for our border/padding to change, but for the overall logic
al width of the block to | 218 // It's possible for our border/padding to change, but for the overall logic
al width of the block to |
| 219 // end up being the same. We keep track of this change so in layoutBlock, we
can know to set relayoutChildren=true. | 219 // end up being the same. We keep track of this change so in layoutBlock, we
can know to set relayoutChildren=true. |
| 220 m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff.needsFullLayout()
&& needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle); | 220 m_hasBorderOrPaddingLogicalWidthChanged = oldStyle && diff.needsFullLayout()
&& needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, newStyle); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void RenderBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintInva
lidationState) | |
| 224 { | |
| 225 // Note, we don't want to early out here using shouldCheckForInvalidationAft
erLayout as | |
| 226 // we have to make sure we go through any positioned objects as they won't b
e seen in | |
| 227 // the normal tree walk. | |
| 228 | |
| 229 RenderBox::invalidateTreeIfNeeded(paintInvalidationState); | |
| 230 | |
| 231 // Take care of positioned objects. This is required as PaintInvalidationSta
te keeps a single clip rect. | |
| 232 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects(
)) { | |
| 233 TrackedRendererListHashSet::iterator end = positionedObjects->end(); | |
| 234 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustCom
positedContainerForSpecialAncestors(&paintInvalidationState.paintInvalidationCon
tainer()); | |
| 235 PaintInvalidationState childPaintInvalidationState(paintInvalidationStat
e, *this, newPaintInvalidationContainer); | |
| 236 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin(
); it != end; ++it) { | |
| 237 RenderBox* box = *it; | |
| 238 box->invalidateTreeIfNeeded(childPaintInvalidationState); | |
| 239 } | |
| 240 } | |
| 241 } | |
| 242 | |
| 243 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) | 223 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) |
| 244 { | 224 { |
| 245 if (beforeChild && beforeChild->parent() != this) { | 225 if (beforeChild && beforeChild->parent() != this) { |
| 246 RenderObject* beforeChildContainer = beforeChild->parent(); | 226 RenderObject* beforeChildContainer = beforeChild->parent(); |
| 247 ASSERT(beforeChildContainer->parent() == this); | 227 ASSERT(beforeChildContainer->parent() == this); |
| 248 ASSERT(beforeChildContainer->isAnonymousBlock()); | 228 ASSERT(beforeChildContainer->isAnonymousBlock()); |
| 249 addChild(newChild, beforeChildContainer); | 229 addChild(newChild, beforeChildContainer); |
| 250 return; | 230 return; |
| 251 } | 231 } |
| 252 | 232 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 { | 479 { |
| 500 TrackedRendererListHashSet* positionedDescendants = positionedObjects(); | 480 TrackedRendererListHashSet* positionedDescendants = positionedObjects(); |
| 501 if (!positionedDescendants) | 481 if (!positionedDescendants) |
| 502 return; | 482 return; |
| 503 | 483 |
| 504 RenderBox* r; | 484 RenderBox* r; |
| 505 TrackedRendererListHashSet::iterator end = positionedDescendants->end(); | 485 TrackedRendererListHashSet::iterator end = positionedDescendants->end(); |
| 506 for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(
); it != end; ++it) { | 486 for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(
); it != end; ++it) { |
| 507 r = *it; | 487 r = *it; |
| 508 | 488 |
| 509 // FIXME: this should only be set from clearNeedsLayout crbug.com/361250 | |
| 510 r->setLayoutDidGetCalled(true); | |
| 511 | |
| 512 SubtreeLayoutScope layoutScope(*r); | 489 SubtreeLayoutScope layoutScope(*r); |
| 513 | 490 |
| 514 // When a non-positioned block element moves, it may have positioned chi
ldren that are implicitly positioned relative to the | 491 // When a non-positioned block element moves, it may have positioned chi
ldren that are implicitly positioned relative to the |
| 515 // non-positioned block. Rather than trying to detect all of these move
ment cases, we just always lay out positioned | 492 // non-positioned block. Rather than trying to detect all of these move
ment cases, we just always lay out positioned |
| 516 // objects that are positioned implicitly like this. Such objects are r
are, and so in typical DHTML menu usage (where everything is | 493 // objects that are positioned implicitly like this. Such objects are r
are, and so in typical DHTML menu usage (where everything is |
| 517 // positioned explicitly) this should not incur a performance penalty. | 494 // positioned explicitly) this should not incur a performance penalty. |
| 518 if (relayoutChildren || (r->style()->hasStaticBlockPosition() && r->pare
nt() != this)) | 495 if (relayoutChildren || (r->style()->hasStaticBlockPosition() && r->pare
nt() != this)) |
| 519 layoutScope.setChildNeedsLayout(r); | 496 layoutScope.setChildNeedsLayout(r); |
| 520 | 497 |
| 521 // If relayoutChildren is set and the child has percentage padding or an
embedded content box, we also need to invalidate the childs pref widths. | 498 // If relayoutChildren is set and the child has percentage padding or an
embedded content box, we also need to invalidate the childs pref widths. |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 1984 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 2008 { | 1985 { |
| 2009 showRenderObject(); | 1986 showRenderObject(); |
| 2010 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 1987 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 2011 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 1988 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 2012 } | 1989 } |
| 2013 | 1990 |
| 2014 #endif | 1991 #endif |
| 2015 | 1992 |
| 2016 } // namespace blink | 1993 } // namespace blink |
| OLD | NEW |