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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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; } | 61 virtual bool isRenderMultiColumnFlowThread() const { return false; } |
| 62 virtual bool isRenderPagedFlowThread() const { return false; } | 62 virtual bool isRenderPagedFlowThread() const { return false; } |
| 63 | 63 |
| 64 virtual void layout() override; | 64 virtual void layout() override; |
| 65 | 65 |
| 66 // Always create a RenderLayer for the RenderFlowThread so that we | 66 // Always create a RenderLayer for the RenderFlowThread so that we |
| 67 // can easily avoid drawing the children directly. | 67 // can easily avoid drawing the children directly. |
| 68 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; } | 68 virtual LayerType layerTypeRequired() const override final { return NormalLa yer; } |
| 69 | 69 |
| 70 virtual bool isColumnSpanner(const RenderObject*) const { return false; } | |
| 71 | |
| 72 // Is the specified renderer a column spanner or inside one? | |
| 73 virtual bool isInsideColumnSpanner(const RenderObject*) const { return false ; } | |
| 74 | |
| 75 virtual LayoutUnit enterColumnSpannerBeforeLayout(RenderBox*, LayoutUnit log icalTop, SubtreeLayoutScope&) { return LayoutUnit(); } | |
| 76 virtual void leaveColumnSpannerAfterLayout(RenderBox*, LayoutUnit logicalBot tom) { } | |
| 70 virtual void flowThreadDescendantWasInserted(RenderObject*) { } | 77 virtual void flowThreadDescendantWasInserted(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(); } |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 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; | |
|
mstensho (USE GERRIT)
2014/11/07 16:06:01
Note: made this public to be able to write a unit
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |