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

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

Issue 335963002: Change LayoutState to be stack-allocated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix push function to match old behavior... Created 6 years, 6 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // Note, we don't want to early out here using shouldCheckForInvalidationAft erLayout as 370 // Note, we don't want to early out here using shouldCheckForInvalidationAft erLayout as
371 // we have to make sure we go through any positioned objects as they won't b e seen in 371 // we have to make sure we go through any positioned objects as they won't b e seen in
372 // the normal tree walk. 372 // the normal tree walk.
373 373
374 if (shouldCheckForPaintInvalidationAfterLayout()) 374 if (shouldCheckForPaintInvalidationAfterLayout())
375 RenderBox::invalidateTreeAfterLayout(invalidationContainer); 375 RenderBox::invalidateTreeAfterLayout(invalidationContainer);
376 376
377 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. 377 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect.
378 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { 378 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) {
379 TrackedRendererListHashSet::iterator end = positionedObjects->end(); 379 TrackedRendererListHashSet::iterator end = positionedObjects->end();
380 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); 380 LayoutState state(*this, isTableRow() ? LayoutSize() : locationOffset()) ;
381 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { 381 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) {
382 RenderBox* box = *it; 382 RenderBox* box = *it;
383 383
384 // One of the renderers we're skipping over here may be the child's repaint container, 384 // One of the renderers we're skipping over here may be the child's repaint container,
385 // so we can't pass our own repaint container along. 385 // so we can't pass our own repaint container along.
386 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForPaintInvalidation(); 386 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForPaintInvalidation();
387 387
388 // If the positioned renderer is absolutely positioned and it is ins ide 388 // If the positioned renderer is absolutely positioned and it is ins ide
389 // a relatively positioend inline element, we need to account for 389 // a relatively positioend inline element, we need to account for
390 // the inline elements position in LayoutState. 390 // the inline elements position in LayoutState.
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 // Check if we need to do a full layout. 1566 // Check if we need to do a full layout.
1567 if (normalChildNeedsLayout() || selfNeedsLayout()) 1567 if (normalChildNeedsLayout() || selfNeedsLayout())
1568 return false; 1568 return false;
1569 1569
1570 // Check that we actually need to do a simplified layout. 1570 // Check that we actually need to do a simplified layout.
1571 if (!posChildNeedsLayout() && !(needsSimplifiedNormalFlowLayout() || needsPo sitionedMovementLayout())) 1571 if (!posChildNeedsLayout() && !(needsSimplifiedNormalFlowLayout() || needsPo sitionedMovementLayout()))
1572 return false; 1572 return false;
1573 1573
1574 1574
1575 { 1575 {
1576 // LayoutStateMaintainer needs this deliberate scope to pop before repai nt 1576 // LayoutState needs this deliberate scope to pop before repaint
1577 LayoutStateMaintainer statePusher(*this, locationOffset()); 1577 LayoutState state(*this, locationOffset());
1578 1578
1579 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only()) 1579 if (needsPositionedMovementLayout() && !tryLayoutDoingPositionedMovement Only())
1580 return false; 1580 return false;
1581 1581
1582 FastTextAutosizer::LayoutScope fastTextAutosizerLayoutScope(this); 1582 FastTextAutosizer::LayoutScope fastTextAutosizerLayoutScope(this);
1583 1583
1584 // Lay out positioned descendants or objects that just need to recompute overflow. 1584 // Lay out positioned descendants or objects that just need to recompute overflow.
1585 if (needsSimplifiedNormalFlowLayout()) 1585 if (needsSimplifiedNormalFlowLayout())
1586 simplifiedNormalFlowLayout(); 1586 simplifiedNormalFlowLayout();
1587 1587
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after
5037 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5037 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5038 { 5038 {
5039 showRenderObject(); 5039 showRenderObject();
5040 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5040 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5041 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5041 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5042 } 5042 }
5043 5043
5044 #endif 5044 #endif
5045 5045
5046 } // namespace WebCore 5046 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698