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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp

Issue 2784493002: Stop appending fragmentainer groups when flow thread offset approaches infinity. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/doubly-nested-with-insane-child-height-crash.html ('k') | no next file » | 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 return false; 251 return false;
252 } 252 }
253 253
254 // So, there's not enough room in the last fragmentainer group. However, 254 // So, there's not enough room in the last fragmentainer group. However,
255 // there can only ever be one fragmentainer group per column set if we're not 255 // there can only ever be one fragmentainer group per column set if we're not
256 // nested inside another fragmentation context. We'll just create overflowing 256 // nested inside another fragmentation context. We'll just create overflowing
257 // columns if the fragmentainer group cannot hold all the content. 257 // columns if the fragmentainer group cannot hold all the content.
258 if (!multiColumnFlowThread()->enclosingFragmentationContext()) 258 if (!multiColumnFlowThread()->enclosingFragmentationContext())
259 return false; 259 return false;
260 260
261 // If we have reached the limits of what a LayoutUnit can hold, we better
262 // stop, or we'd end up with zero-height columns.
263 if (offsetInFlowThread.mightBeSaturated())
264 return false;
265
261 // We're in a nested fragmentation context, and the last fragmentainer group 266 // We're in a nested fragmentation context, and the last fragmentainer group
262 // cannot hold content at the specified offset without overflowing. This 267 // cannot hold content at the specified offset without overflowing. This
263 // usually warrants a new fragmentainer group; however, this will not be the 268 // usually warrants a new fragmentainer group; however, this will not be the
264 // case if we have already allocated all available block space in this 269 // case if we have already allocated all available block space in this
265 // multicol container. When setting up a new fragmentainer group, we always 270 // multicol container. When setting up a new fragmentainer group, we always
266 // constrain against the remaining portion of any specified 271 // constrain against the remaining portion of any specified
267 // height/max-height. This means that we shouldn't allow creation of 272 // height/max-height. This means that we shouldn't allow creation of
268 // fragmentainer groups below the bottom of the multicol container, or we'd 273 // fragmentainer groups below the bottom of the multicol container, or we'd
269 // end up with zero-height fragmentainer groups (or actually 1px; see 274 // end up with zero-height fragmentainer groups (or actually 1px; see
270 // heightAdjustedForRowOffset() in MultiColumnFragmentainerGroup, which 275 // heightAdjustedForRowOffset() in MultiColumnFragmentainerGroup, which
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // Now add in column rule bounds, if present. 615 // Now add in column rule bounds, if present.
611 Vector<LayoutRect> columnRuleBounds; 616 Vector<LayoutRect> columnRuleBounds;
612 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { 617 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) {
613 for (auto& bound : columnRuleBounds) 618 for (auto& bound : columnRuleBounds)
614 blockFlowBounds.unite(bound); 619 blockFlowBounds.unite(bound);
615 } 620 }
616 return blockFlowBounds; 621 return blockFlowBounds;
617 } 622 }
618 623
619 } // namespace blink 624 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/doubly-nested-with-insane-child-height-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698