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

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

Issue 2709013007: Allow flow thread portion logical bottom to be above its logical top. (Closed)
Patch Set: Add clarifying comment in logicalHeightInFlowThread() Created 3 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) 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 PageBoundaryRule) const; 142 PageBoundaryRule) const;
143 143
144 MultiColumnFragmentainerGroup& appendNewFragmentainerGroup(); 144 MultiColumnFragmentainerGroup& appendNewFragmentainerGroup();
145 145
146 // Logical top relative to the content edge of the multicol container. 146 // Logical top relative to the content edge of the multicol container.
147 LayoutUnit logicalTopFromMulticolContentEdge() const; 147 LayoutUnit logicalTopFromMulticolContentEdge() const;
148 148
149 LayoutUnit logicalTopInFlowThread() const; 149 LayoutUnit logicalTopInFlowThread() const;
150 LayoutUnit logicalBottomInFlowThread() const; 150 LayoutUnit logicalBottomInFlowThread() const;
151 LayoutUnit logicalHeightInFlowThread() const { 151 LayoutUnit logicalHeightInFlowThread() const {
152 return logicalBottomInFlowThread() - logicalTopInFlowThread(); 152 // Due to negative margins, logical bottom may actually end up above logical
153 // top, but we never want to return negative logical heights.
154 return (logicalBottomInFlowThread() - logicalTopInFlowThread())
155 .clampNegativeToZero();
153 } 156 }
154 157
155 // Return the amount of flow thread contents that the specified fragmentainer 158 // Return the amount of flow thread contents that the specified fragmentainer
156 // group can hold without overflowing. 159 // group can hold without overflowing.
157 LayoutUnit fragmentainerGroupCapacity( 160 LayoutUnit fragmentainerGroupCapacity(
158 const MultiColumnFragmentainerGroup& group) const { 161 const MultiColumnFragmentainerGroup& group) const {
159 return group.logicalHeight() * usedColumnCount(); 162 return group.logicalHeight() * usedColumnCount();
160 } 163 }
161 164
162 LayoutRect flowThreadPortionRect() const; 165 LayoutRect flowThreadPortionRect() const;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 LayoutUnit m_oldLogicalTop; 276 LayoutUnit m_oldLogicalTop;
274 277
275 bool m_initialHeightCalculated; 278 bool m_initialHeightCalculated;
276 }; 279 };
277 280
278 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet()); 281 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet());
279 282
280 } // namespace blink 283 } // namespace blink
281 284
282 #endif // LayoutMultiColumnSet_h 285 #endif // LayoutMultiColumnSet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698