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

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

Issue 1343163005: Remove special pagination code for floats and out-of-flow objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « no previous file | Source/core/layout/LayoutBlockFlow.cpp » ('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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 if (!positionedObject->normalChildNeedsLayout() && (relayoutChildren || needsLayoutDueToStaticPosition(positionedObject))) 1254 if (!positionedObject->normalChildNeedsLayout() && (relayoutChildren || needsLayoutDueToStaticPosition(positionedObject)))
1255 layoutScope.setChildNeedsLayout(positionedObject); 1255 layoutScope.setChildNeedsLayout(positionedObject);
1256 1256
1257 // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths. 1257 // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.
1258 if (relayoutChildren && positionedObject->needsPreferredWidthsRecalculat ion()) 1258 if (relayoutChildren && positionedObject->needsPreferredWidthsRecalculat ion())
1259 positionedObject->setPreferredLogicalWidthsDirty(MarkOnlyThis); 1259 positionedObject->setPreferredLogicalWidthsDirty(MarkOnlyThis);
1260 1260
1261 if (!positionedObject->needsLayout()) 1261 if (!positionedObject->needsLayout())
1262 positionedObject->markForPaginationRelayoutIfNeeded(layoutScope); 1262 positionedObject->markForPaginationRelayoutIfNeeded(layoutScope);
1263 1263
1264 // If we are paginated or in a line grid, go ahead and compute a vertica l position for our object now.
1265 // If it's wrong we'll lay out again.
1266 LayoutUnit oldLogicalTop = 0;
1267 bool needsBlockDirectionLocationSetBeforeLayout = positionedObject->need sLayout() && view()->layoutState()->needsBlockDirectionLocationSetBeforeLayout() ;
1268 if (needsBlockDirectionLocationSetBeforeLayout) {
1269 if (isHorizontalWritingMode() == positionedObject->isHorizontalWriti ngMode())
1270 positionedObject->updateLogicalHeight();
1271 else
1272 positionedObject->updateLogicalWidth();
1273 oldLogicalTop = logicalTopForChild(*positionedObject);
1274 }
1275
1276 // FIXME: We should be able to do a r->setNeedsPositionedMovementLayout( ) here instead of a full layout. Need 1264 // FIXME: We should be able to do a r->setNeedsPositionedMovementLayout( ) here instead of a full layout. Need
1277 // to investigate why it does not trigger the correct invalidations in t hat case. crbug.com/350756 1265 // to investigate why it does not trigger the correct invalidations in t hat case. crbug.com/350756
1278 if (info == ForcedLayoutAfterContainingBlockMoved) 1266 if (info == ForcedLayoutAfterContainingBlockMoved)
1279 positionedObject->setNeedsLayout(LayoutInvalidationReason::AncestorM oved, MarkOnlyThis); 1267 positionedObject->setNeedsLayout(LayoutInvalidationReason::AncestorM oved, MarkOnlyThis);
1280 1268
1281 positionedObject->layoutIfNeeded(); 1269 positionedObject->layoutIfNeeded();
1282
1283 // Lay out again if our estimate was wrong.
1284 if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(*po sitionedObject) != oldLogicalTop)
1285 positionedObject->forceChildLayout();
1286 } 1270 }
1287 } 1271 }
1288 1272
1289 void LayoutBlock::markPositionedObjectsForLayout() 1273 void LayoutBlock::markPositionedObjectsForLayout()
1290 { 1274 {
1291 if (TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects() ) { 1275 if (TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects() ) {
1292 for (auto* descendant : *positionedDescendants) 1276 for (auto* descendant : *positionedDescendants)
1293 descendant->setChildNeedsLayout(); 1277 descendant->setChildNeedsLayout();
1294 } 1278 }
1295 } 1279 }
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2891 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2908 { 2892 {
2909 showLayoutObject(); 2893 showLayoutObject();
2910 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2894 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2911 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2895 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2912 } 2896 }
2913 2897
2914 #endif 2898 #endif
2915 2899
2916 } // namespace blink 2900 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698