| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 bool pageLogicalSizeChanged() const { return m_pageLogicalSizeChanged; } | 99 bool pageLogicalSizeChanged() const { return m_pageLogicalSizeChanged; } |
| 100 | 100 |
| 101 void collectLayerFragments(LayerFragments&, const LayoutRect& layerBoundingB
ox, const LayoutRect& dirtyRect); | 101 void collectLayerFragments(LayerFragments&, const LayoutRect& layerBoundingB
ox, const LayoutRect& dirtyRect); |
| 102 LayoutRect fragmentsBoundingBox(const LayoutRect& layerBoundingBox) const; | 102 LayoutRect fragmentsBoundingBox(const LayoutRect& layerBoundingBox) const; |
| 103 | 103 |
| 104 LayoutPoint flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint)
const | 104 LayoutPoint flowThreadPointToVisualPoint(const LayoutPoint& flowThreadPoint)
const |
| 105 { | 105 { |
| 106 return flowThreadPoint + columnOffset(flowThreadPoint); | 106 return flowThreadPoint + columnOffset(flowThreadPoint); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void pushFlowThreadLayoutState(const RenderObject&); | |
| 110 void popFlowThreadLayoutState(); | |
| 111 LayoutUnit offsetFromLogicalTopOfFirstRegion(const RenderBlock*) const; | |
| 112 | |
| 113 // Used to estimate the maximum height of the flow thread. | 109 // Used to estimate the maximum height of the flow thread. |
| 114 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } | 110 static LayoutUnit maxLogicalHeight() { return LayoutUnit::max() / 2; } |
| 115 | 111 |
| 116 protected: | 112 protected: |
| 117 virtual const char* renderName() const = 0; | 113 virtual const char* renderName() const = 0; |
| 118 | 114 |
| 119 void updateRegionsFlowThreadPortionRect(); | 115 void updateRegionsFlowThreadPortionRect(); |
| 120 | 116 |
| 121 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0; | 117 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const = 0; |
| 122 | 118 |
| 123 bool cachedOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit&)
const; | |
| 124 void setOffsetFromLogicalTopOfFirstRegion(const RenderBox*, LayoutUnit); | |
| 125 void clearOffsetFromLogicalTopOfFirstRegion(const RenderBox*); | |
| 126 | |
| 127 const RenderBox* currentStatePusherRenderBox() const; | |
| 128 | |
| 129 RenderMultiColumnSetList m_multiColumnSetList; | 119 RenderMultiColumnSetList m_multiColumnSetList; |
| 130 | 120 |
| 131 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva
l; | 121 typedef PODInterval<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInterva
l; |
| 132 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt
ervalTree; | 122 typedef PODIntervalTree<LayoutUnit, RenderMultiColumnSet*> MultiColumnSetInt
ervalTree; |
| 133 | 123 |
| 134 class RegionSearchAdapter { | 124 class RegionSearchAdapter { |
| 135 public: | 125 public: |
| 136 RegionSearchAdapter(LayoutUnit offset) | 126 RegionSearchAdapter(LayoutUnit offset) |
| 137 : m_offset(offset) | 127 : m_offset(offset) |
| 138 , m_result(0) | 128 , m_result(0) |
| 139 { | 129 { |
| 140 } | 130 } |
| 141 | 131 |
| 142 const LayoutUnit& lowValue() const { return m_offset; } | 132 const LayoutUnit& lowValue() const { return m_offset; } |
| 143 const LayoutUnit& highValue() const { return m_offset; } | 133 const LayoutUnit& highValue() const { return m_offset; } |
| 144 void collectIfNeeded(const MultiColumnSetInterval&); | 134 void collectIfNeeded(const MultiColumnSetInterval&); |
| 145 | 135 |
| 146 RenderRegion* result() const { return m_result; } | 136 RenderRegion* result() const { return m_result; } |
| 147 | 137 |
| 148 private: | 138 private: |
| 149 LayoutUnit m_offset; | 139 LayoutUnit m_offset; |
| 150 RenderRegion* m_result; | 140 RenderRegion* m_result; |
| 151 }; | 141 }; |
| 152 | 142 |
| 153 // Stack of objects that pushed a LayoutState object on the RenderView. The | |
| 154 // objects on the stack are the ones that are curently in the process of bei
ng | |
| 155 // laid out. | |
| 156 ListHashSet<const RenderObject*> m_statePusherObjectsStack; | |
| 157 typedef HashMap<const RenderBox*, LayoutUnit> RenderBoxToOffsetMap; | |
| 158 RenderBoxToOffsetMap m_boxesToOffsetMap; | |
| 159 | |
| 160 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; | 143 MultiColumnSetIntervalTree m_multiColumnSetIntervalTree; |
| 161 | 144 |
| 162 bool m_regionsInvalidated : 1; | 145 bool m_regionsInvalidated : 1; |
| 163 bool m_regionsHaveUniformLogicalHeight : 1; | 146 bool m_regionsHaveUniformLogicalHeight : 1; |
| 164 bool m_pageLogicalSizeChanged : 1; | 147 bool m_pageLogicalSizeChanged : 1; |
| 165 }; | 148 }; |
| 166 | 149 |
| 167 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlowThread, isRenderFlowThread()); | 150 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlowThread, isRenderFlowThread()); |
| 168 | 151 |
| 169 // These structures are used by PODIntervalTree for debugging. | 152 // These structures are used by PODIntervalTree for debugging. |
| 170 #ifndef NDEBUG | 153 #ifndef NDEBUG |
| 171 template <> struct ValueToString<LayoutUnit> { | 154 template <> struct ValueToString<LayoutUnit> { |
| 172 static String string(const LayoutUnit value) { return String::number(value.t
oFloat()); } | 155 static String string(const LayoutUnit value) { return String::number(value.t
oFloat()); } |
| 173 }; | 156 }; |
| 174 | 157 |
| 175 template <> struct ValueToString<RenderMultiColumnSet*> { | 158 template <> struct ValueToString<RenderMultiColumnSet*> { |
| 176 static String string(const RenderMultiColumnSet* value) { return String::for
mat("%p", value); } | 159 static String string(const RenderMultiColumnSet* value) { return String::for
mat("%p", value); } |
| 177 }; | 160 }; |
| 178 #endif | 161 #endif |
| 179 | 162 |
| 180 } // namespace blink | 163 } // namespace blink |
| 181 | 164 |
| 182 #endif // RenderFlowThread_h | 165 #endif // RenderFlowThread_h |
| OLD | NEW |