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

Side by Side Diff: Source/core/layout/LayoutBlock.cpp

Issue 1236793005: Always include floating children into visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaselines (see the try job results of the previous patch set for expectation changes) Created 5 years, 5 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
« no previous file with comments | « Source/core/layout/LayoutBlock.h ('k') | Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 } 924 }
925 925
926 void LayoutBlock::addOverflowFromChildren() 926 void LayoutBlock::addOverflowFromChildren()
927 { 927 {
928 if (childrenInline()) 928 if (childrenInline())
929 toLayoutBlockFlow(this)->addOverflowFromInlineChildren(); 929 toLayoutBlockFlow(this)->addOverflowFromInlineChildren();
930 else 930 else
931 addOverflowFromBlockChildren(); 931 addOverflowFromBlockChildren();
932 } 932 }
933 933
934 void LayoutBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool) 934 void LayoutBlock::computeOverflow(LayoutUnit oldClientAfterEdge)
935 { 935 {
936 m_overflow.clear(); 936 m_overflow.clear();
937 937
938 // Add overflow from children. 938 // Add overflow from children.
939 addOverflowFromChildren(); 939 addOverflowFromChildren();
940 940
941 // Add in the overflow from positioned objects. 941 // Add in the overflow from positioned objects.
942 addOverflowFromPositionedObjects(); 942 addOverflowFromPositionedObjects();
943 943
944 if (hasOverflowClip()) { 944 if (hasOverflowClip()) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 layoutPositionedObjects(false, needsPositionedMovementLayout() ? For cedLayoutAfterContainingBlockMoved : (!posChildNeedsLayout() && canContainFixedP osObjects ? LayoutOnlyFixedPositionedObjects : DefaultLayout)); 1089 layoutPositionedObjects(false, needsPositionedMovementLayout() ? For cedLayoutAfterContainingBlockMoved : (!posChildNeedsLayout() && canContainFixedP osObjects ? LayoutOnlyFixedPositionedObjects : DefaultLayout));
1090 1090
1091 // Recompute our overflow information. 1091 // Recompute our overflow information.
1092 // FIXME: We could do better here by computing a temporary overflow obje ct from layoutPositionedObjects and only 1092 // FIXME: We could do better here by computing a temporary overflow obje ct from layoutPositionedObjects and only
1093 // updating our overflow if we either used to have overflow or if the ne w temporary object has overflow. 1093 // updating our overflow if we either used to have overflow or if the ne w temporary object has overflow.
1094 // For now just always recompute overflow. This is no worse performance- wise than the old code that called rightmostPosition and 1094 // For now just always recompute overflow. This is no worse performance- wise than the old code that called rightmostPosition and
1095 // lowestPosition on every relayout so it's not a regression. 1095 // lowestPosition on every relayout so it's not a regression.
1096 // computeOverflow expects the bottom edge before we clamp our height. S ince this information isn't available during 1096 // computeOverflow expects the bottom edge before we clamp our height. S ince this information isn't available during
1097 // simplifiedLayout, we cache the value in m_overflow. 1097 // simplifiedLayout, we cache the value in m_overflow.
1098 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC lientAfterEdge() : clientLogicalBottom(); 1098 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutC lientAfterEdge() : clientLogicalBottom();
1099 computeOverflow(oldClientAfterEdge, true); 1099 computeOverflow(oldClientAfterEdge);
1100 } 1100 }
1101 1101
1102 updateLayerTransformAfterLayout(); 1102 updateLayerTransformAfterLayout();
1103 1103
1104 updateScrollInfoAfterLayout(); 1104 updateScrollInfoAfterLayout();
1105 1105
1106 clearNeedsLayout(); 1106 clearNeedsLayout();
1107 1107
1108 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer()) 1108 if (LayoutAnalyzer* analyzer = frameView()->layoutAnalyzer())
1109 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou t); 1109 analyzer->increment(LayoutAnalyzer::LayoutObjectsThatNeedSimplifiedLayou t);
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 if (!selfNeedsOverflowRecalcAfterStyleChange() && !childrenOverflowChanged) 2811 if (!selfNeedsOverflowRecalcAfterStyleChange() && !childrenOverflowChanged)
2812 return false; 2812 return false;
2813 2813
2814 setSelfNeedsOverflowRecalcAfterStyleChange(false); 2814 setSelfNeedsOverflowRecalcAfterStyleChange(false);
2815 // If the current block needs layout, overflow will be recalculated during 2815 // If the current block needs layout, overflow will be recalculated during
2816 // layout time anyway. We can safely exit here. 2816 // layout time anyway. We can safely exit here.
2817 if (needsLayout()) 2817 if (needsLayout())
2818 return false; 2818 return false;
2819 2819
2820 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutClien tAfterEdge() : clientLogicalBottom(); 2820 LayoutUnit oldClientAfterEdge = hasOverflowModel() ? m_overflow->layoutClien tAfterEdge() : clientLogicalBottom();
2821 computeOverflow(oldClientAfterEdge, true); 2821 computeOverflow(oldClientAfterEdge);
2822 2822
2823 if (hasOverflowClip()) 2823 if (hasOverflowClip())
2824 layer()->scrollableArea()->updateAfterOverflowRecalc(); 2824 layer()->scrollableArea()->updateAfterOverflowRecalc();
2825 2825
2826 return !hasOverflowClip(); 2826 return !hasOverflowClip();
2827 } 2827 }
2828 2828
2829 // Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted 2829 // Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted
2830 // that just updates the object's position. If the size does change, the object remains dirty. 2830 // that just updates the object's position. If the size does change, the object remains dirty.
2831 bool LayoutBlock::tryLayoutDoingPositionedMovementOnly() 2831 bool LayoutBlock::tryLayoutDoingPositionedMovementOnly()
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2895 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2895 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2896 { 2896 {
2897 showLayoutObject(); 2897 showLayoutObject();
2898 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2898 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2899 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2899 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2900 } 2900 }
2901 2901
2902 #endif 2902 #endif
2903 2903
2904 } // namespace blink 2904 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.h ('k') | Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698