Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 30 matching lines...) Expand all Loading... | |
| 107 return flowThreadPoint + columnOffset(flowThreadPoint); | 114 return flowThreadPoint + columnOffset(flowThreadPoint); |
| 108 } | 115 } |
| 109 | 116 |
| 110 void pushFlowThreadLayoutState(const RenderObject&); | 117 void pushFlowThreadLayoutState(const RenderObject&); |
| 111 void popFlowThreadLayoutState(); | 118 void popFlowThreadLayoutState(); |
| 112 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; | 119 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; |
| 113 | 120 |
| 114 // Used to estimate the maximum height of the flow thread. | 121 // Used to estimate the maximum height of the flow thread. |
| 115 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } | 122 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } |
| 116 | 123 |
| 124 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0; | |
| 125 | |
| 117 protected: | 126 protected: |
| 118 virtual const char* renderName() const = 0; | 127 virtual const char* renderName() const = 0; |
| 119 | 128 |
| 120 void updateRegionsFlowThreadPortionRect(); | 129 void updateRegionsFlowThreadPortionRect(); |
| 121 | 130 |
| 122 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0; | |
| 123 | |
| 124 bool cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit&) const; | 131 bool cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit&) const; |
| 125 void setOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit); | 132 void setOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit); |
| 126 void clearOffsetFromLogicalTopOfFirstRegion(const RenderBox*); | 133 void clearOffsetFromLogicalTopOfFirstRegion(const RenderBox*); |
| 127 | 134 |
| 128 const RenderBox* currentStatePusherRenderBox() const; | 135 const RenderBox* currentStatePusherRenderBox() const; |
| 129 | 136 |
| 130 RenderMultiColumnSetList m_multiColumnSetList; | 137 RenderMultiColumnSetList m_multiColumnSetList; |
| 131 | 138 |
| 132 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l; | 139 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva l; |
| 133 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree; | 140 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt ervalTree; |
| 134 | 141 |
| 135 class RegionSearchAdapter { | 142 class MultiColumnSetSearchAdapter { |
| 136 public: | 143 public: |
| 137 RegionSearchAdapter(LayoutUnit offset) | 144 MultiColumnSetSearchAdapter(LayoutUnit offset) |
| 138 : m_offset(offset) | 145 : m_offset(offset) |
| 139 , m_result(0) | 146 , m_result(0) |
| 140 { | 147 { |
| 141 } | 148 } |
| 142 | 149 |
| 143 const LayoutUnit& lowValue() const { return m_offset; } | 150 const LayoutUnit& lowValue() const { return m_offset; } |
| 144 const LayoutUnit& highValue() const { return m_offset; } | 151 const LayoutUnit& highValue() const { return m_offset; } |
| 145 void collectIfNeeded(const MultiColumnSetInterval&); | 152 void collectIfNeeded(const MultiColumnSetInterval&); |
| 146 | 153 |
| 147 RenderRegion* result() const { return m_result; } | 154 RenderMultiColumnSet* result() const { return m_result; } |
| 148 | 155 |
| 149 private: | 156 private: |
| 150 LayoutUnit m_offset; | 157 LayoutUnit m_offset; |
| 151 RenderRegion* m_result; | 158 RenderMultiColumnSet* m_result; |
| 152 }; | 159 }; |
|
Julien - ping for review
2015/01/19 10:05:11
FYI I keep reading this patch which looks like a g
| |
| 153 | 160 |
| 154 // Stack of objects that pushed a LayoutState object on the RenderView. The | 161 // Stack of objects that pushed a LayoutState object on the RenderView. The |
| 155 // objects on the stack are the ones that are curently in the process of bei ng | 162 // objects on the stack are the ones that are curently in the process of bei ng |
| 156 // laid out. | 163 // laid out. |
| 157 ListHashSet<const RenderObject*> m_statePusherObjectsStack; | 164 ListHashSet<const RenderObject*> m_statePusherObjectsStack; |
| 158 typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap; | 165 typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap; |
| 159 RenderBoxToOffsetMap m_boxesToOffsetMap; | 166 RenderBoxToOffsetMap m_boxesToOffsetMap; |
| 160 | 167 |
| 161 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; | 168 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; |
| 162 | 169 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 174 }; | 181 }; |
| 175 | 182 |
| 176 template <> struct ValueToString<RenderMultiColumnSet*> { | 183 template <> struct ValueToString<RenderMultiColumnSet*> { |
| 177 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); } | 184 static String string(const RenderMultiColumnSet* value) { return String::for mat("%p", value); } |
| 178 }; | 185 }; |
| 179 #endif | 186 #endif |
| 180 | 187 |
| 181 } // namespace blink | 188 } // namespace blink |
| 182 | 189 |
| 183 #endif // RenderFlowThread_h | 190 #endif // RenderFlowThread_h |
| OLD | NEW |