| 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 12 matching lines...) Expand all Loading... |
| 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef RenderFlowThread_h | 30 #ifndef RenderFlowThread_h |
| 31 #define RenderFlowThread_h | 31 #define RenderFlowThread_h |
| 32 | 32 |
| 33 #include "core/rendering/LayerFragment.h" | 33 #include "core/layout/LayerFragment.h" |
| 34 #include "core/rendering/RenderBlockFlow.h" | 34 #include "core/rendering/RenderBlockFlow.h" |
| 35 #include "wtf/ListHashSet.h" | 35 #include "wtf/ListHashSet.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class RenderMultiColumnSet; | 39 class RenderMultiColumnSet; |
| 40 class RenderRegion; | 40 class RenderRegion; |
| 41 | 41 |
| 42 typedef ListHashSet<RenderMultiColumnSet*> RenderMultiColumnSetList; | 42 typedef ListHashSet<RenderMultiColumnSet*> RenderMultiColumnSetList; |
| 43 | 43 |
| 44 // RenderFlowThread is used to collect all the render objects that participate i
n a | 44 // RenderFlowThread is used to collect all the render objects that participate i
n a |
| 45 // flow thread. It will also help in doing the layout. However, it will not rend
er | 45 // flow thread. It will also help in doing the layout. However, it will not rend
er |
| 46 // directly to screen. Instead, RenderRegion objects will redirect their paint | 46 // directly to screen. Instead, RenderRegion objects will redirect their paint |
| 47 // and nodeAtPoint methods to this object. Each RenderRegion will actually be a
viewPort | 47 // and nodeAtPoint methods to this object. Each RenderRegion will actually be a
viewPort |
| 48 // of the RenderFlowThread. | 48 // of the RenderFlowThread. |
| 49 | 49 |
| 50 class RenderFlowThread: public RenderBlockFlow { | 50 class RenderFlowThread: public RenderBlockFlow { |
| 51 public: | 51 public: |
| 52 RenderFlowThread(); | 52 RenderFlowThread(); |
| 53 virtual ~RenderFlowThread() { }; | 53 virtual ~RenderFlowThread() { }; |
| 54 | 54 |
| 55 virtual bool isRenderFlowThread() const override final { return true; } | 55 virtual bool isRenderFlowThread() const override final { return true; } |
| 56 virtual bool isRenderMultiColumnFlowThread() const { return false; } | 56 virtual bool isRenderMultiColumnFlowThread() const { return false; } |
| 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 Layer 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 | 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 | 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 | 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 | 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. | 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(); } | 72 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow
Thread) { return LayoutUnit(); } |
| 73 | 73 |
| 74 virtual void flowThreadDescendantWasInserted(RenderObject*) { } | 74 virtual void flowThreadDescendantWasInserted(RenderObject*) { } |
| 75 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) { } | 75 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) { } |
| 76 | 76 |
| 77 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; |
| 78 | 78 |
| 79 virtual void addRegionToThread(RenderMultiColumnSet*) = 0; | 79 virtual void addRegionToThread(RenderMultiColumnSet*) = 0; |
| 80 virtual void removeRegionFromThread(RenderMultiColumnSet*); | 80 virtual void removeRegionFromThread(RenderMultiColumnSet*); |
| 81 | 81 |
| 82 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 82 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
| 83 | 83 |
| 84 bool hasRegions() const { return m_multiColumnSetList.size(); } | 84 bool hasRegions() const { return m_multiColumnSetList.size(); } |
| 85 | 85 |
| 86 void validateRegions(); | 86 void validateRegions(); |
| 87 void invalidateRegions(); | 87 void invalidateRegions(); |
| 88 bool hasValidRegionInfo() const { return !m_regionsInvalidated && !m_multiCo
lumnSetList.isEmpty(); } | 88 bool hasValidRegionInfo() const { return !m_regionsInvalidated && !m_multiCo
lumnSetList.isEmpty(); } |
| 89 | 89 |
| 90 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o
verride; | 90 virtual void mapRectToPaintInvalidationBacking(const LayoutLayerModelObject*
paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o
verride; |
| 91 | 91 |
| 92 LayoutUnit pageLogicalHeightForOffset(LayoutUnit); | 92 LayoutUnit pageLogicalHeightForOffset(LayoutUnit); |
| 93 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule
= IncludePageBoundary); | 93 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule
= IncludePageBoundary); |
| 94 | 94 |
| 95 virtual void setPageBreak(LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*
/) { } | 95 virtual void setPageBreak(LayoutUnit /*offset*/, LayoutUnit /*spaceShortage*
/) { } |
| 96 virtual void updateMinimumPageHeight(LayoutUnit /*offset*/, LayoutUnit /*min
Height*/) { } | 96 virtual void updateMinimumPageHeight(LayoutUnit /*offset*/, LayoutUnit /*min
Height*/) { } |
| 97 | 97 |
| 98 bool regionsHaveUniformLogicalHeight() const { return m_regionsHaveUniformLo
gicalHeight; } | 98 bool regionsHaveUniformLogicalHeight() const { return m_regionsHaveUniformLo
gicalHeight; } |
| 99 | 99 |
| 100 // FIXME: These 2 functions should return a RenderMultiColumnSet. | 100 // FIXME: These 2 functions should return a RenderMultiColumnSet. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 template <> struct ValueToString<RenderMultiColumnSet*> { | 166 template <> struct ValueToString<RenderMultiColumnSet*> { |
| 167 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); } |
| 168 }; | 168 }; |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| 172 | 172 |
| 173 #endif // RenderFlowThread_h | 173 #endif // RenderFlowThread_h |
| OLD | NEW |