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

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

Issue 1886703002: ColumnBalancer: don't skip bounds checking on first or last fragmentainer groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/MultiColumnFragmentainerGroup.h" 5 #include "core/layout/MultiColumnFragmentainerGroup.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 // A column balancer traverses the portion of the subtree of a flow thread that belongs to a given 9 // A column balancer traverses the portion of the subtree of a flow thread that belongs to a given
10 // fragmentainer group, in order to collect certain data to be used for column b alancing. This is an 10 // fragmentainer group, in order to collect certain data to be used for column b alancing. This is an
(...skipping 15 matching lines...) Expand all
26 { 26 {
27 if (flowThreadOffset != m_group.columnLogicalTopForOffset(flowThreadOffs et)) 27 if (flowThreadOffset != m_group.columnLogicalTopForOffset(flowThreadOffs et))
28 return false; // Not at the top of a column. 28 return false; // Not at the top of a column.
29 // The first column in the fragmentainer group is either not after any b reak at all, or 29 // The first column in the fragmentainer group is either not after any b reak at all, or
30 // after a break that belongs to the previous fragmentainer group. 30 // after a break that belongs to the previous fragmentainer group.
31 return flowThreadOffset > m_group.logicalTopInFlowThread(); 31 return flowThreadOffset > m_group.logicalTopInFlowThread();
32 } 32 }
33 33
34 bool isLogicalTopWithinBounds(LayoutUnit logicalTopInFlowThread) const 34 bool isLogicalTopWithinBounds(LayoutUnit logicalTopInFlowThread) const
35 { 35 {
36 return (m_group.isFirstGroup() || logicalTopInFlowThread >= m_group.logi calTopInFlowThread()) 36 return logicalTopInFlowThread >= m_group.logicalTopInFlowThread()
37 && (m_group.isLastGroup() || logicalTopInFlowThread < m_group.logica lBottomInFlowThread()); 37 && logicalTopInFlowThread < m_group.logicalBottomInFlowThread();
38 } 38 }
39 39
40 bool isLogicalBottomWithinBounds(LayoutUnit logicalBottomInFlowThread) const 40 bool isLogicalBottomWithinBounds(LayoutUnit logicalBottomInFlowThread) const
41 { 41 {
42 return (m_group.isFirstGroup() || logicalBottomInFlowThread > m_group.lo gicalTopInFlowThread()) 42 return logicalBottomInFlowThread > m_group.logicalTopInFlowThread()
43 && (m_group.isLastGroup() || logicalBottomInFlowThread <= m_group.lo gicalBottomInFlowThread()); 43 && logicalBottomInFlowThread <= m_group.logicalBottomInFlowThread();
44 } 44 }
45 45
46 // Examine and collect column balancing data from a layout box that has been found to intersect 46 // Examine and collect column balancing data from a layout box that has been found to intersect
47 // with this fragmentainer group. Does not recurse into children. flowThread Offset() will 47 // with this fragmentainer group. Does not recurse into children. flowThread Offset() will
48 // return the offset from |box| to the flow thread. Two hooks are provided h ere. The first one 48 // return the offset from |box| to the flow thread. Two hooks are provided h ere. The first one
49 // is called right after entering and before traversing the subtree of the b ox, and the second 49 // is called right after entering and before traversing the subtree of the b ox, and the second
50 // one right after having traversed the subtree. 50 // one right after having traversed the subtree.
51 virtual void examineBoxAfterEntering(const LayoutBox&) = 0; 51 virtual void examineBoxAfterEntering(const LayoutBox&) = 0;
52 virtual void examineBoxBeforeLeaving(const LayoutBox&) = 0; 52 virtual void examineBoxBeforeLeaving(const LayoutBox&) = 0;
53 53
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 LayoutUnit m_minimumSpaceShortage; 195 LayoutUnit m_minimumSpaceShortage;
196 196
197 // Set when breaking before a block, and we're looking for the first unbreak able descendant, in 197 // Set when breaking before a block, and we're looking for the first unbreak able descendant, in
198 // order to report correct space shortage for that one. 198 // order to report correct space shortage for that one.
199 LayoutUnit m_pendingStrut; 199 LayoutUnit m_pendingStrut;
200 200
201 unsigned m_forcedBreaksCount; 201 unsigned m_forcedBreaksCount;
202 }; 202 };
203 203
204 } // namespace blink 204 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698