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

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

Issue 1558133002: Soften assertion slightly, to survive saturated arithmetic situations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return remainingLogicalHeight; 92 return remainingLogicalHeight;
93 } 93 }
94 94
95 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const 95 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const
96 { 96 {
97 return firstFragmentainerGroup().logicalHeight(); 97 return firstFragmentainerGroup().logicalHeight();
98 } 98 }
99 99
100 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent(LayoutUnit flowThreadOffset, LayoutUnit contentLogicalHeight) const 100 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent(LayoutUnit flowThreadOffset, LayoutUnit contentLogicalHeight) const
101 { 101 {
102 ASSERT(pageLogicalTopForOffset(flowThreadOffset) == flowThreadOffset); 102 ASSERT(flowThreadOffset.mightBeSaturated() || pageLogicalTopForOffset(flowTh readOffset) == flowThreadOffset);
103 FragmentationContext* enclosingFragmentationContext = multiColumnFlowThread( )->enclosingFragmentationContext(); 103 FragmentationContext* enclosingFragmentationContext = multiColumnFlowThread( )->enclosingFragmentationContext();
104 if (!enclosingFragmentationContext) { 104 if (!enclosingFragmentationContext) {
105 // If there's no enclosing fragmentation context, there'll ever be only one row, and all 105 // If there's no enclosing fragmentation context, there'll ever be only one row, and all
106 // columns there will have the same height. 106 // columns there will have the same height.
107 return flowThreadOffset; 107 return flowThreadOffset;
108 } 108 }
109 109
110 // Assert the problematic situation. If we have no problem with the column h eight, why are we 110 // Assert the problematic situation. If we have no problem with the column h eight, why are we
111 // even here? 111 // even here?
112 ASSERT(pageLogicalHeightForOffset(flowThreadOffset) < contentLogicalHeight); 112 ASSERT(pageLogicalHeightForOffset(flowThreadOffset) < contentLogicalHeight);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const 398 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
399 { 399 {
400 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread()); 400 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread());
401 if (!isHorizontalWritingMode()) 401 if (!isHorizontalWritingMode())
402 return portionRect.transposedRect(); 402 return portionRect.transposedRect();
403 return portionRect; 403 return portionRect;
404 } 404 }
405 405
406 } 406 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/short-columns-insane-unbreakable-content-height-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698