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

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

Issue 1461923005: When balancing columns, we must check inner multicols for unbreakable content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const MultiColumnFragmentainerGroup& fragmentainerGroupAtVisualPoint(const L ayoutPoint&) const; 75 const MultiColumnFragmentainerGroup& fragmentainerGroupAtVisualPoint(const L ayoutPoint&) const;
76 76
77 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectLayoutMultiColumnSet || LayoutBlockFlow::isOfType(type); } 77 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectLayoutMultiColumnSet || LayoutBlockFlow::isOfType(type); }
78 bool canHaveChildren() const final { return false; } 78 bool canHaveChildren() const final { return false; }
79 79
80 // Return the width and height of a single column or page in the set. 80 // Return the width and height of a single column or page in the set.
81 LayoutUnit pageLogicalWidth() const { return flowThread()->logicalWidth(); } 81 LayoutUnit pageLogicalWidth() const { return flowThread()->logicalWidth(); }
82 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const; 82 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const;
83 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule) const; 83 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule) const;
84 bool isPageLogicalHeightKnown() const; 84 bool isPageLogicalHeightKnown() const;
85 LayoutUnit tallestUnbreakableLogicalHeight() const { return m_tallestUnbreak ableLogicalHeight; }
86 void propagateTallestUnbreakableLogicalHeight(LayoutUnit value) { m_tallestU nbreakableLogicalHeight = std::max(value, m_tallestUnbreakableLogicalHeight); }
85 87
86 LayoutFlowThread* flowThread() const { return m_flowThread; } 88 LayoutFlowThread* flowThread() const { return m_flowThread; }
87 89
88 LayoutBlockFlow* multiColumnBlockFlow() const { return toLayoutBlockFlow(par ent()); } 90 LayoutBlockFlow* multiColumnBlockFlow() const { return toLayoutBlockFlow(par ent()); }
89 LayoutMultiColumnFlowThread* multiColumnFlowThread() const { return toLayout MultiColumnFlowThread(flowThread()); } 91 LayoutMultiColumnFlowThread* multiColumnFlowThread() const { return toLayout MultiColumnFlowThread(flowThread()); }
90 92
91 LayoutMultiColumnSet* nextSiblingMultiColumnSet() const; 93 LayoutMultiColumnSet* nextSiblingMultiColumnSet() const;
92 LayoutMultiColumnSet* previousSiblingMultiColumnSet() const; 94 LayoutMultiColumnSet* previousSiblingMultiColumnSet() const;
93 95
94 MultiColumnFragmentainerGroup& appendNewFragmentainerGroup(); 96 MultiColumnFragmentainerGroup& appendNewFragmentainerGroup();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 163
162 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override; 164 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override;
163 PositionWithAffinity positionForPoint(const LayoutPoint&) override; 165 PositionWithAffinity positionForPoint(const LayoutPoint&) override;
164 166
165 void paintObject(const PaintInfo&, const LayoutPoint& paintOffset) const ove rride; 167 void paintObject(const PaintInfo&, const LayoutPoint& paintOffset) const ove rride;
166 168
167 void addOverflowFromChildren() override; 169 void addOverflowFromChildren() override;
168 170
169 MultiColumnFragmentainerGroupList m_fragmentainerGroups; 171 MultiColumnFragmentainerGroupList m_fragmentainerGroups;
170 LayoutFlowThread* m_flowThread; 172 LayoutFlowThread* m_flowThread;
173
174 // Height of the tallest piece of unbreakable content. This is the minimum c olumn logical height
175 // required to avoid fragmentation where it shouldn't occur (inside unbreaka ble content, between
176 // orphans and widows, etc.). We only store this so that outer fragmentation contexts (if any)
177 // can query this when calculating their own minimum. Note that we don't sto re this value in
178 // every fragmentainer group (but rather here, in the column set), since we only need the
179 // largest one among them.
180 LayoutUnit m_tallestUnbreakableLogicalHeight;
171 }; 181 };
172 182
173 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet()); 183 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet());
174 184
175 } // namespace blink 185 } // namespace blink
176 186
177 #endif // LayoutMultiColumnSet_h 187 #endif // LayoutMultiColumnSet_h
178 188
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698