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

Side by Side Diff: Source/core/rendering/RenderFlowThread.h

Issue 792803002: [New Multicolumn] Layout support for column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@347325-placeholder
Patch Set: Code review. If there are no sets, return early. Created 5 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
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFlowThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 virtual bool isRenderPagedFlowThread() const { return false; } 57 virtual bool isRenderPagedFlowThread() const { return false; }
58 58
59 virtual bool supportsPaintInvalidationStateCachedOffsets() const override { return false; } 59 virtual bool supportsPaintInvalidationStateCachedOffsets() const override { return false; }
60 60
61 virtual void layout() override; 61 virtual void layout() override;
62 62
63 // Always create a RenderLayer for the RenderFlowThread so that we 63 // Always create a RenderLayer for the RenderFlowThread so that we
64 // can easily avoid drawing the children directly. 64 // can easily avoid drawing the children directly.
65 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; } 65 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; }
66 66
67 // Skip past a column spanner during flow thread layout. Spanners are not la id out inside the
68 // flow thread, since the flow thread is not in a spanner's containing block chain (since the
69 // containing block is the multicol container). If the spanner follows right after a column set
70 // (as opposed to following another spanner), we may have to stretch the flo w thread to ensure
71 // completely filled columns in the preceding column set. Return this adjust ment, if any.
72 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow Thread) { return LayoutUnit(); }
73
67 virtual void flowThreadDescendantWasInserted(RenderObject*) { } 74 virtual void flowThreadDescendantWasInserted(RenderObject*) { }
68 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) { } 75 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) { }
69 76
70 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final; 77 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final;
71 78
72 virtual void addRegionToThread(RenderMultiColumnSet*) = 0; 79 virtual void addRegionToThread(RenderMultiColumnSet*) = 0;
73 virtual void removeRegionFromThread(RenderMultiColumnSet*); 80 virtual void removeRegionFromThread(RenderMultiColumnSet*);
74 81
75 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const override; 82 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const override;
76 83
(...skipping 26 matching lines...) Expand all
103 LayoutRect fragmentsBoundingBox(const LayoutRect& layerBoundingBox) const; 110 LayoutRect fragmentsBoundingBox(const LayoutRect& layerBoundingBox) const;
104 111
105 LayoutPoint flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint) const 112 LayoutPoint flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint) const
106 { 113 {
107 return flowThreadPoint + columnOffset(flowThreadPoint); 114 return flowThreadPoint + columnOffset(flowThreadPoint);
108 } 115 }
109 116
110 // Used to estimate the maximum height of the flow thread. 117 // Used to estimate the maximum height of the flow thread.
111 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } 118 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; }
112 119
120 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0;
121
113 protected: 122 protected:
114 virtual const char* renderName() const = 0; 123 virtual const char* renderName() const = 0;
115 124
116 void updateRegionsFlowThreadPortionRect(); 125 void updateRegionsFlowThreadPortionRect();
117 126
118 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0;
119
120 RenderMultiColumnSetList m_multiColumnSetList; 127 RenderMultiColumnSetList m_multiColumnSetList;
121 128
122 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l; 129 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l;
123 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree; 130 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree;
124 131
125 class RegionSearchAdapter { 132 class MultiColumnSetSearchAdapter {
126 public: 133 public:
127 RegionSearchAdapter(LayoutUnit offset) 134 MultiColumnSetSearchAdapter(LayoutUnit offset)
128 : m_offset(offset) 135 : m_offset(offset)
129 , m_result(0) 136 , m_result(0)
130 { 137 {
131 } 138 }
132 139
133 const LayoutUnit& lowValue() const { return m_offset; } 140 const LayoutUnit& lowValue() const { return m_offset; }
134 const LayoutUnit& highValue() const { return m_offset; } 141 const LayoutUnit& highValue() const { return m_offset; }
135 void collectIfNeeded(const MultiColumnSetInterval&); 142 void collectIfNeeded(const MultiColumnSetInterval&);
136 143
137 RenderRegion* result() const { return m_result; } 144 RenderMultiColumnSet* result() const { return m_result; }
138 145
139 private: 146 private:
140 LayoutUnit m_offset; 147 LayoutUnit m_offset;
141 RenderRegion* m_result; 148 RenderMultiColumnSet* m_result;
142 }; 149 };
143 150
144 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; 151 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree;
145 152
146 bool m_regionsInvalidated : 1; 153 bool m_regionsInvalidated : 1;
147 bool m_regionsHaveUniformLogicalHeight : 1; 154 bool m_regionsHaveUniformLogicalHeight : 1;
148 bool m_pageLogicalSizeChanged : 1; 155 bool m_pageLogicalSizeChanged : 1;
149 }; 156 };
150 157
151 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlowThread, isRenderFlowThread()); 158 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlowThread, isRenderFlowThread());
152 159
153 // These structures are used by PODIntervalTree for debugging. 160 // These structures are used by PODIntervalTree for debugging.
154 #ifndef NDEBUG 161 #ifndef NDEBUG
155 template <> struct ValueToString<LayoutUnit> { 162 template <> struct ValueToString<LayoutUnit> {
156 static String string(const LayoutUnit value) { return String::number(value.t oFloat()); } 163 static String string(const LayoutUnit value) { return String::number(value.t oFloat()); }
157 }; 164 };
158 165
159 template <> struct ValueToString<RenderMultiColumnSet*> { 166 template <> struct ValueToString<RenderMultiColumnSet*> {
160 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); } 167 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); }
161 }; 168 };
162 #endif 169 #endif
163 170
164 } // namespace blink 171 } // namespace blink
165 172
166 #endif // RenderFlowThread_h 173 #endif // RenderFlowThread_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFlowThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698