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

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

Issue 160903002: Move RenderLayer repainting to repaint-after-layout framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 6 years, 9 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
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 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 return; 1738 return;
1739 1739
1740 if (hasColumns()) 1740 if (hasColumns())
1741 view()->layoutState()->clearPaginationInformation(); // Positioned objec ts are not part of the column flow, so they don't paginate with the columns. 1741 view()->layoutState()->clearPaginationInformation(); // Positioned objec ts are not part of the column flow, so they don't paginate with the columns.
1742 1742
1743 RenderBox* r; 1743 RenderBox* r;
1744 TrackedRendererListHashSet::iterator end = positionedDescendants->end(); 1744 TrackedRendererListHashSet::iterator end = positionedDescendants->end();
1745 for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin( ); it != end; ++it) { 1745 for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin( ); it != end; ++it) {
1746 r = *it; 1746 r = *it;
1747 1747
1748 LayoutRectRecorder recorder(*r);
1749
1748 SubtreeLayoutScope layoutScope(r); 1750 SubtreeLayoutScope layoutScope(r);
1749 // A fixed position element with an absolute positioned ancestor has no way of knowing if the latter has changed position. So 1751 // A fixed position element with an absolute positioned ancestor has no way of knowing if the latter has changed position. So
1750 // if this is a fixed position element, mark it for layout if it has an abspos ancestor and needs to move with that ancestor, i.e. 1752 // if this is a fixed position element, mark it for layout if it has an abspos ancestor and needs to move with that ancestor, i.e.
1751 // it has static position. 1753 // it has static position.
1752 markFixedPositionObjectForLayoutIfNeeded(r, layoutScope); 1754 markFixedPositionObjectForLayoutIfNeeded(r, layoutScope);
1753 if (fixedPositionObjectsOnly) { 1755 if (fixedPositionObjectsOnly) {
1754 r->layoutIfNeeded(); 1756 r->layoutIfNeeded();
1755 continue; 1757 continue;
1756 } 1758 }
1757 1759
(...skipping 21 matching lines...) Expand all
1779 LayoutUnit oldLogicalTop = 0; 1781 LayoutUnit oldLogicalTop = 0;
1780 bool needsBlockDirectionLocationSetBeforeLayout = r->needsLayout() && vi ew()->layoutState()->needsBlockDirectionLocationSetBeforeLayout(); 1782 bool needsBlockDirectionLocationSetBeforeLayout = r->needsLayout() && vi ew()->layoutState()->needsBlockDirectionLocationSetBeforeLayout();
1781 if (needsBlockDirectionLocationSetBeforeLayout) { 1783 if (needsBlockDirectionLocationSetBeforeLayout) {
1782 if (isHorizontalWritingMode() == r->isHorizontalWritingMode()) 1784 if (isHorizontalWritingMode() == r->isHorizontalWritingMode())
1783 r->updateLogicalHeight(); 1785 r->updateLogicalHeight();
1784 else 1786 else
1785 r->updateLogicalWidth(); 1787 r->updateLogicalWidth();
1786 oldLogicalTop = logicalTopForChild(r); 1788 oldLogicalTop = logicalTopForChild(r);
1787 } 1789 }
1788 1790
1789 r->layoutIfNeeded(); 1791 if (r->needsLayout())
1792 r->layout();
1793 else
1794 r->setShouldDoFullRepaintAfterLayout(true);
Julien - ping for review 2014/03/04 18:22:10 This will cause all positioned objects to be repai
dsinclair 2014/03/04 19:21:52 Done.
1790 1795
1791 // Lay out again if our estimate was wrong. 1796 // Lay out again if our estimate was wrong.
1792 if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) 1797 if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop)
1793 r->forceChildLayout(); 1798 r->forceChildLayout();
1794 } 1799 }
1795 1800
1796 if (hasColumns()) 1801 if (hasColumns())
1797 view()->layoutState()->m_columnInfo = columnInfo(); // FIXME: Kind of gr oss. We just put this back into the layout state so that pop() will work. 1802 view()->layoutState()->m_columnInfo = columnInfo(); // FIXME: Kind of gr oss. We just put this back into the layout state so that pop() will work.
1798 } 1803 }
1799 1804
(...skipping 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5023 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5019 { 5024 {
5020 showRenderObject(); 5025 showRenderObject();
5021 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5026 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5022 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5027 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5023 } 5028 }
5024 5029
5025 #endif 5030 #endif
5026 5031
5027 } // namespace WebCore 5032 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698