OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class RenderBlockFlow; | 36 class RenderBlockFlow; |
37 class RenderBox; | 37 class RenderBox; |
38 class RenderObject; | 38 class RenderObject; |
39 class RenderFlowThread; | 39 class RenderFlowThread; |
40 class ShapeInsideInfo; | 40 class ShapeInsideInfo; |
41 | 41 |
42 class LayoutState { | 42 class LayoutState { |
43 WTF_MAKE_NONCOPYABLE(LayoutState); | 43 WTF_MAKE_NONCOPYABLE(LayoutState); |
44 public: | 44 public: |
45 LayoutState() | 45 // Constructor for root LayoutState created by RenderView |
| 46 LayoutState(LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged) |
46 : m_clipped(false) | 47 : m_clipped(false) |
47 , m_isPaginated(false) | 48 , m_isPaginated(pageLogicalHeight) |
48 , m_pageLogicalHeightChanged(false) | 49 , m_pageLogicalHeightChanged(pageLogicalHeightChanged) |
49 #if !ASSERT_DISABLED | 50 #if !ASSERT_DISABLED |
50 , m_layoutDeltaXSaturated(false) | 51 , m_layoutDeltaXSaturated(false) |
51 , m_layoutDeltaYSaturated(false) | 52 , m_layoutDeltaYSaturated(false) |
52 #endif | 53 #endif |
53 , m_columnInfo(0) | 54 , m_columnInfo(0) |
54 , m_next(0) | 55 , m_next(0) |
55 , m_shapeInsideInfo(0) | 56 , m_shapeInsideInfo(0) |
56 , m_pageLogicalHeight(0) | 57 , m_pageLogicalHeight(pageLogicalHeight) |
57 #ifndef NDEBUG | 58 #ifndef NDEBUG |
58 , m_renderer(0) | 59 , m_renderer(0) |
59 #endif | 60 #endif |
60 { | 61 { |
61 } | 62 } |
62 | 63 |
63 LayoutState(LayoutState*, RenderBox&, const LayoutSize& offset, LayoutUnit p
ageHeight, bool pageHeightChanged, ColumnInfo*); | 64 LayoutState(LayoutState*, RenderBox&, const LayoutSize& offset, LayoutUnit p
ageLogicalHeight, bool pageHeightLogicalChanged, ColumnInfo*); |
64 explicit LayoutState(RenderObject&); | 65 explicit LayoutState(RenderObject&); |
65 | 66 |
66 // LayoutState is allocated out of the rendering partition. | 67 // LayoutState is allocated out of the rendering partition. |
67 void* operator new(size_t); | 68 void* operator new(size_t); |
68 void operator delete(void*); | 69 void operator delete(void*); |
69 | 70 |
70 void clearPaginationInformation(); | 71 void clearPaginationInformation(); |
71 bool isPaginatingColumns() const { return m_columnInfo; } | 72 bool isPaginatingColumns() const { return m_columnInfo; } |
72 bool isPaginated() const { return m_isPaginated; } | 73 bool isPaginated() const { return m_isPaginated; } |
| 74 bool isClipped() const { return m_clipped; } |
73 | 75 |
74 // The page logical offset is the object's offset from the top of the page i
n the page progression | 76 // The page logical offset is the object's offset from the top of the page i
n the page progression |
75 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | 77 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
76 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; | 78 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; |
77 | 79 |
78 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); | 80 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); |
79 | 81 |
| 82 void addLayoutDelta(const LayoutSize& delta) |
| 83 { |
| 84 m_layoutDelta += delta; |
| 85 #if !ASSERT_DISABLED |
| 86 m_layoutDeltaXSaturated |= m_layoutDelta.width() == LayoutUnit::max(
) || m_layoutDelta.width() == LayoutUnit::min(); |
| 87 m_layoutDeltaYSaturated |= m_layoutDelta.height() == LayoutUnit::max
() || m_layoutDelta.height() == LayoutUnit::min(); |
| 88 #endif |
| 89 } |
| 90 |
| 91 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } |
| 92 |
| 93 const LayoutSize& layoutOffset() const { return m_layoutOffset; } |
| 94 const LayoutSize& layoutDelta() const { return m_layoutDelta; } |
| 95 const LayoutSize& pageOffset() const { return m_pageOffset; } |
80 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } | 96 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } |
81 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } | 97 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } |
82 | 98 |
83 LayoutSize layoutOffset() const { return m_layoutOffset; } | 99 LayoutState* next() const { return m_next; } |
84 | 100 |
85 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } | 101 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } |
86 | 102 |
87 ShapeInsideInfo* shapeInsideInfo() const { return m_shapeInsideInfo; } | 103 ShapeInsideInfo* shapeInsideInfo() const { return m_shapeInsideInfo; } |
| 104 ColumnInfo* columnInfo() const { return m_columnInfo; } |
| 105 |
| 106 const LayoutRect& clipRect() const { return m_clipRect; } |
| 107 const LayoutSize& paintOffset() const { return m_paintOffset; } |
88 | 108 |
89 #ifndef NDEBUG | 109 #ifndef NDEBUG |
90 RenderObject* renderer() const { return m_renderer; } | 110 RenderObject* renderer() const { return m_renderer; } |
91 #endif | 111 #endif |
| 112 #if !ASSERT_DISABLED |
| 113 bool layoutDeltaXSaturated() const { return m_layoutDeltaXSaturated; } |
| 114 bool layoutDeltaYSaturated() const { return m_layoutDeltaYSaturated; } |
| 115 #endif |
92 | 116 |
93 public: | 117 private: |
94 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 | 118 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 |
95 bool m_clipped:1; | 119 bool m_clipped:1; |
96 bool m_isPaginated:1; | 120 bool m_isPaginated:1; |
97 // If our page height has changed, this will force all blocks to relayout. | 121 // If our page height has changed, this will force all blocks to relayout. |
98 bool m_pageLogicalHeightChanged:1; | 122 bool m_pageLogicalHeightChanged:1; |
99 #if !ASSERT_DISABLED | 123 #if !ASSERT_DISABLED |
100 bool m_layoutDeltaXSaturated:1; | 124 bool m_layoutDeltaXSaturated:1; |
101 bool m_layoutDeltaYSaturated:1; | 125 bool m_layoutDeltaYSaturated:1; |
102 #endif | 126 #endif |
103 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. | 127 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. |
(...skipping 20 matching lines...) Expand all Loading... |
124 LayoutSize m_pageOffset; | 148 LayoutSize m_pageOffset; |
125 | 149 |
126 #ifndef NDEBUG | 150 #ifndef NDEBUG |
127 RenderObject* m_renderer; | 151 RenderObject* m_renderer; |
128 #endif | 152 #endif |
129 }; | 153 }; |
130 | 154 |
131 } // namespace WebCore | 155 } // namespace WebCore |
132 | 156 |
133 #endif // LayoutState_h | 157 #endif // LayoutState_h |
OLD | NEW |