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

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

Issue 712553003: [New Multicolumn] Actual support for layout of column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review. Camelize. Created 6 years 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // directly to screen. Instead, RenderRegion objects will redirect their paint 51 // directly to screen. Instead, RenderRegion objects will redirect their paint
52 // and nodeAtPoint methods to this object. Each RenderRegion will actually be a viewPort 52 // and nodeAtPoint methods to this object. Each RenderRegion will actually be a viewPort
53 // of the RenderFlowThread. 53 // of the RenderFlowThread.
54 54
55 class RenderFlowThread: public RenderBlockFlow { 55 class RenderFlowThread: public RenderBlockFlow {
56 public: 56 public:
57 RenderFlowThread(); 57 RenderFlowThread();
58 virtual ~RenderFlowThread() { }; 58 virtual ~RenderFlowThread() { };
59 59
60 virtual bool isRenderFlowThread() const override final { return true; } 60 virtual bool isRenderFlowThread() const override final { return true; }
61 virtual bool isRenderMultiColumnFlowThread() const { return false; }
62 virtual bool isRenderPagedFlowThread() const { return false; } 61 virtual bool isRenderPagedFlowThread() const { return false; }
63 62
64 virtual void layout() override; 63 virtual void layout() override;
65 64
66 // Always create a RenderLayer for the RenderFlowThread so that we 65 // Always create a RenderLayer for the RenderFlowThread so that we
67 // can easily avoid drawing the children directly. 66 // can easily avoid drawing the children directly.
68 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; } 67 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; }
69 68
69 virtual bool isColumnSpanner(const RenderObject*) const { return false; }
70
71 // Is the specified renderer a column spanner or inside one?
72 virtual bool isInsideColumnSpanner(const RenderObject*) const { return false ; }
73
74 virtual LayoutUnit enterColumnSpannerBeforeLayout(RenderBox*, LayoutUnit log icalTop, SubtreeLayoutScope&) { return LayoutUnit(); }
75 virtual void exitColumnSpannerAfterLayout(RenderBox*, LayoutUnit logicalBott om) { }
70 virtual void flowThreadDescendantWasInserted(RenderObject*) { } 76 virtual void flowThreadDescendantWasInserted(RenderObject*) { }
77 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) { }
71 78
72 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final; 79 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final;
73 80
74 virtual void addRegionToThread(RenderMultiColumnSet*) = 0; 81 virtual void addRegionToThread(RenderMultiColumnSet*) = 0;
75 virtual void removeRegionFromThread(RenderMultiColumnSet*); 82 virtual void removeRegionFromThread(RenderMultiColumnSet*);
76 83
77 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const override; 84 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const override;
78 85
79 bool hasRegions() const { return m_multiColumnSetList.size(); } 86 bool hasRegions() const { return m_multiColumnSetList.size(); }
80 87
(...skipping 28 matching lines...) Expand all
109 return flowThreadPoint + columnOffset(flowThreadPoint); 116 return flowThreadPoint + columnOffset(flowThreadPoint);
110 } 117 }
111 118
112 void pushFlowThreadLayoutState(const RenderObject&); 119 void pushFlowThreadLayoutState(const RenderObject&);
113 void popFlowThreadLayoutState(); 120 void popFlowThreadLayoutState();
114 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; 121 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const;
115 122
116 // Used to estimate the maximum height of the flow thread. 123 // Used to estimate the maximum height of the flow thread.
117 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } 124 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; }
118 125
126 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0;
127
119 protected: 128 protected:
120 virtual const char* renderName() const = 0; 129 virtual const char* renderName() const = 0;
121 130
122 void updateRegionsFlowThreadPortionRect(); 131 void updateRegionsFlowThreadPortionRect();
123 bool shouldIssuePaintInvalidations(const LayoutRect&) const; 132 bool shouldIssuePaintInvalidations(const LayoutRect&) const;
124 133
125 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0;
126
127 bool cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit&) const; 134 bool cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit&) const;
128 void setOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit); 135 void setOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit);
129 void clearOffsetFromLogicalTopOfFirstRegion(const RenderBox*); 136 void clearOffsetFromLogicalTopOfFirstRegion(const RenderBox*);
130 137
131 const RenderBox* currentStatePusherRenderBox() const; 138 const RenderBox* currentStatePusherRenderBox() const;
132 139
133 RenderMultiColumnSetList m_multiColumnSetList; 140 RenderMultiColumnSetList m_multiColumnSetList;
134 141
135 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l; 142 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l;
136 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree; 143 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree;
137 144
138 class RegionSearchAdapter { 145 class MultiColumnSetSearchAdapter {
139 public: 146 public:
140 RegionSearchAdapter(LayoutUnit offset) 147 MultiColumnSetSearchAdapter(LayoutUnit offset)
141 : m_offset(offset) 148 : m_offset(offset)
142 , m_result(0) 149 , m_result(0)
143 { 150 {
144 } 151 }
145 152
146 const LayoutUnit& lowValue() const { return m_offset; } 153 const LayoutUnit& lowValue() const { return m_offset; }
147 const LayoutUnit& highValue() const { return m_offset; } 154 const LayoutUnit& highValue() const { return m_offset; }
148 void collectIfNeeded(const MultiColumnSetInterval&); 155 void collectIfNeeded(const MultiColumnSetInterval&);
149 156
150 RenderRegion* result() const { return m_result; } 157 RenderMultiColumnSet* result() const { return m_result; }
151 158
152 private: 159 private:
153 LayoutUnit m_offset; 160 LayoutUnit m_offset;
154 RenderRegion* m_result; 161 RenderMultiColumnSet* m_result;
155 }; 162 };
156 163
157 // Stack of objects that pushed a LayoutState object on the RenderView. The 164 // Stack of objects that pushed a LayoutState object on the RenderView. The
158 // objects on the stack are the ones that are curently in the process of bei ng 165 // objects on the stack are the ones that are curently in the process of bei ng
159 // laid out. 166 // laid out.
160 ListHashSet<const RenderObject*> m_statePusherObjectsStack; 167 ListHashSet<const RenderObject*> m_statePusherObjectsStack;
161 typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap; 168 typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap;
162 RenderBoxToOffsetMap m_boxesToOffsetMap; 169 RenderBoxToOffsetMap m_boxesToOffsetMap;
163 170
164 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; 171 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree;
(...skipping 22 matching lines...) Expand all
187 }; 194 };
188 195
189 template <> struct ValueToString<RenderMultiColumnSet*> { 196 template <> struct ValueToString<RenderMultiColumnSet*> {
190 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); } 197 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); }
191 }; 198 };
192 #endif 199 #endif
193 200
194 } // namespace blink 201 } // namespace blink
195 202
196 #endif // RenderFlowThread_h 203 #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