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

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

Issue 2314763002: Replace collectLayerFragments() with FragmentainerIterator. (Closed)
Patch Set: code review. Created 4 years, 3 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // is inside another fragmentation context (e.g. paged media, or an another mult icol container), we 57 // is inside another fragmentation context (e.g. paged media, or an another mult icol container), we
58 // may need to group the columns, so that we get one MultiColumnFragmentainerGro up for each outer 58 // may need to group the columns, so that we get one MultiColumnFragmentainerGro up for each outer
59 // fragmentainer (page / column) that the inner multicol container lives in. Eac h fragmentainer 59 // fragmentainer (page / column) that the inner multicol container lives in. Eac h fragmentainer
60 // group has its own column height, but the column height is uniform within a gr oup. 60 // group has its own column height, but the column height is uniform within a gr oup.
61 class CORE_EXPORT LayoutMultiColumnSet : public LayoutBlockFlow { 61 class CORE_EXPORT LayoutMultiColumnSet : public LayoutBlockFlow {
62 public: 62 public:
63 static LayoutMultiColumnSet* createAnonymous(LayoutFlowThread&, const Comput edStyle& parentStyle); 63 static LayoutMultiColumnSet* createAnonymous(LayoutFlowThread&, const Comput edStyle& parentStyle);
64 64
65 const MultiColumnFragmentainerGroup& firstFragmentainerGroup() const { retur n m_fragmentainerGroups.first(); } 65 const MultiColumnFragmentainerGroup& firstFragmentainerGroup() const { retur n m_fragmentainerGroups.first(); }
66 const MultiColumnFragmentainerGroup& lastFragmentainerGroup() const { return m_fragmentainerGroups.last(); } 66 const MultiColumnFragmentainerGroup& lastFragmentainerGroup() const { return m_fragmentainerGroups.last(); }
67 unsigned fragmentainerGroupIndexAtFlowThreadOffset(LayoutUnit) const;
67 MultiColumnFragmentainerGroup& fragmentainerGroupAtFlowThreadOffset(LayoutUn it flowThreadOffset) 68 MultiColumnFragmentainerGroup& fragmentainerGroupAtFlowThreadOffset(LayoutUn it flowThreadOffset)
68 { 69 {
69 return m_fragmentainerGroups[fragmentainerGroupIndexAtFlowThreadOffset(f lowThreadOffset)]; 70 return m_fragmentainerGroups[fragmentainerGroupIndexAtFlowThreadOffset(f lowThreadOffset)];
70 } 71 }
71 const MultiColumnFragmentainerGroup& fragmentainerGroupAtFlowThreadOffset(La youtUnit flowThreadOffset) const 72 const MultiColumnFragmentainerGroup& fragmentainerGroupAtFlowThreadOffset(La youtUnit flowThreadOffset) const
72 { 73 {
73 return m_fragmentainerGroups[fragmentainerGroupIndexAtFlowThreadOffset(f lowThreadOffset)]; 74 return m_fragmentainerGroups[fragmentainerGroupIndexAtFlowThreadOffset(f lowThreadOffset)];
74 } 75 }
75 const MultiColumnFragmentainerGroup& fragmentainerGroupAtVisualPoint(const L ayoutPoint&) const; 76 const MultiColumnFragmentainerGroup& fragmentainerGroupAtVisualPoint(const L ayoutPoint&) const;
76 const MultiColumnFragmentainerGroupList& fragmentainerGroups() const { retur n m_fragmentainerGroups; } 77 const MultiColumnFragmentainerGroupList& fragmentainerGroups() const { retur n m_fragmentainerGroups; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final; 155 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final;
155 156
156 void attachToFlowThread(); 157 void attachToFlowThread();
157 void detachFromFlowThread(); 158 void detachFromFlowThread();
158 159
159 // The top of the page nearest to the specified block offset. All in flowthr ead coordinates. 160 // The top of the page nearest to the specified block offset. All in flowthr ead coordinates.
160 LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const; 161 LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const;
161 162
162 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c onst; 163 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c onst;
163 164
164 void collectLayerFragments(PaintLayerFragments&, const LayoutRect& layerBoun dingBox, const LayoutRect& dirtyRect);
165
166 LayoutUnit columnGap() const; 165 LayoutUnit columnGap() const;
167 166
168 // The "CSS actual" value of column-count. This includes overflowing columns , if any. 167 // The "CSS actual" value of column-count. This includes overflowing columns , if any.
169 unsigned actualColumnCount() const; 168 unsigned actualColumnCount() const;
170 169
171 const char* name() const override { return "LayoutMultiColumnSet"; } 170 const char* name() const override { return "LayoutMultiColumnSet"; }
172 171
173 // Sets |columnRuleBounds| to the bounds of each column rule rect's painted extent, adjusted by paint offset, 172 // Sets |columnRuleBounds| to the bounds of each column rule rect's painted extent, adjusted by paint offset,
174 // before pixel snapping. Returns true if column rules should be painted at all. 173 // before pixel snapping. Returns true if column rules should be painted at all.
175 bool computeColumnRuleBounds(const LayoutPoint& paintOffset, Vector<LayoutRe ct>& columnRuleBounds) const; 174 bool computeColumnRuleBounds(const LayoutPoint& paintOffset, Vector<LayoutRe ct>& columnRuleBounds) const;
176 175
177 LayoutRect localOverflowRectForPaintInvalidation() const override; 176 LayoutRect localOverflowRectForPaintInvalidation() const override;
178 177
179 protected: 178 protected:
180 LayoutMultiColumnSet(LayoutFlowThread*); 179 LayoutMultiColumnSet(LayoutFlowThread*);
181 180
182 private: 181 private:
183 unsigned fragmentainerGroupIndexAtFlowThreadOffset(LayoutUnit) const;
184
185 void insertedIntoTree() final; 182 void insertedIntoTree() final;
186 void willBeRemovedFromTree() final; 183 void willBeRemovedFromTree() final;
187 184
188 bool isSelfCollapsingBlock() const override { return false; } 185 bool isSelfCollapsingBlock() const override { return false; }
189 186
190 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override; 187 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override;
191 PositionWithAffinity positionForPoint(const LayoutPoint&) override; 188 PositionWithAffinity positionForPoint(const LayoutPoint&) override;
192 189
193 void paintObject(const PaintInfo&, const LayoutPoint& paintOffset) const ove rride; 190 void paintObject(const PaintInfo&, const LayoutPoint& paintOffset) const ove rride;
194 191
(...skipping 15 matching lines...) Expand all
210 207
211 bool m_initialHeightCalculated; 208 bool m_initialHeightCalculated;
212 }; 209 };
213 210
214 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet()); 211 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet());
215 212
216 } // namespace blink 213 } // namespace blink
217 214
218 #endif // LayoutMultiColumnSet_h 215 #endif // LayoutMultiColumnSet_h
219 216
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698