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 24 matching lines...) Expand all Loading... |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class RenderFlowThread; | 37 class RenderFlowThread; |
38 | 38 |
39 class RenderRegion : public RenderBlockFlow { | 39 class RenderRegion : public RenderBlockFlow { |
40 public: | 40 public: |
41 explicit RenderRegion(Element*, RenderFlowThread*); | 41 explicit RenderRegion(Element*, RenderFlowThread*); |
42 | 42 |
43 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectRenderRegion || RenderBlockFlow::isOfType(type); } | 43 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectRenderRegion || RenderBlockFlow::isOfType(type); } |
44 | 44 |
45 void setFlowThreadPortionRect(const LayoutRect& rect) { m_flowThreadPortionR
ect = rect; } | 45 virtual LayoutRect flowThreadPortionRect() const = 0; |
46 LayoutRect flowThreadPortionRect() const { return m_flowThreadPortionRect; } | |
47 LayoutRect flowThreadPortionOverflowRect() const; | 46 LayoutRect flowThreadPortionOverflowRect() const; |
| 47 LayoutRect overflowRectForFlowThreadPortion(const LayoutRect& flowThreadPort
ionRect, bool isFirstPortion, bool isLastPortion) const; |
48 | 48 |
49 RenderFlowThread* flowThread() const { return m_flowThread; } | 49 RenderFlowThread* flowThread() const { return m_flowThread; } |
50 | 50 |
51 // Valid regions do not create circular dependencies with other flows. | 51 // Valid regions do not create circular dependencies with other flows. |
52 bool isValid() const { return m_isValid; } | 52 bool isValid() const { return m_isValid; } |
53 void setIsValid(bool valid) { m_isValid = valid; } | 53 void setIsValid(bool valid) { m_isValid = valid; } |
54 | 54 |
55 bool isFirstRegion() const; | 55 bool isFirstRegion() const; |
56 bool isLastRegion() const; | 56 bool isLastRegion() const; |
57 | 57 |
58 // These methods represent the width and height of a "page" and for a Render
Region they are just | 58 // These methods represent the width and height of a "page" and for a Render
Region they are just |
59 // the content width and content height of a region. For RenderMultiColumnSe
ts, however, they | 59 // the content width and content height of a region. For RenderMultiColumnSe
ts, however, they |
60 // will be the width and height of a single column or page in the set. | 60 // will be the width and height of a single column or page in the set. |
61 virtual LayoutUnit pageLogicalWidth() const; | 61 virtual LayoutUnit pageLogicalWidth() const; |
62 virtual LayoutUnit pageLogicalHeight() const; | 62 virtual LayoutUnit pageLogicalHeight() const; |
63 | 63 |
64 virtual bool canHaveChildren() const override final { return false; } | 64 virtual bool canHaveChildren() const override final { return false; } |
65 virtual bool canHaveGeneratedChildren() const override final { return true;
} | 65 virtual bool canHaveGeneratedChildren() const override final { return true;
} |
66 | 66 |
67 virtual const char* renderName() const override { return "RenderRegion"; } | 67 virtual const char* renderName() const override { return "RenderRegion"; } |
68 | 68 |
69 protected: | 69 protected: |
70 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const override final; | 70 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const override final; |
71 | 71 |
72 LayoutRect overflowRectForFlowThreadPortion(const LayoutRect& flowThreadPort
ionRect, bool isFirstPortion, bool isLastPortion) const; | |
73 | |
74 private: | 72 private: |
75 virtual void layoutBlock(bool relayoutChildren) override final; | 73 virtual void layoutBlock(bool relayoutChildren) override final; |
76 | 74 |
77 protected: | 75 protected: |
78 RenderFlowThread* m_flowThread; | 76 RenderFlowThread* m_flowThread; |
79 | 77 |
80 private: | 78 private: |
81 LayoutRect m_flowThreadPortionRect; | |
82 bool m_isValid : 1; | 79 bool m_isValid : 1; |
83 }; | 80 }; |
84 | 81 |
85 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderRegion, isRenderRegion()); | 82 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderRegion, isRenderRegion()); |
86 | 83 |
87 } // namespace blink | 84 } // namespace blink |
88 | 85 |
89 #endif // RenderRegion_h | 86 #endif // RenderRegion_h |
OLD | NEW |