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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 explicit LayoutState(RenderObject& root); | 48 explicit LayoutState(RenderObject& root); |
49 | 49 |
50 LayoutState(RenderBox&, const LayoutSize& offset, LayoutUnit pageLogicalHeig
ht = 0, bool pageHeightLogicalChanged = false, ColumnInfo* = 0); | 50 LayoutState(RenderBox&, const LayoutSize& offset, LayoutUnit pageLogicalHeig
ht = 0, bool pageHeightLogicalChanged = false, ColumnInfo* = 0); |
51 LayoutState(RenderInline&); | 51 LayoutState(RenderInline&); |
52 | 52 |
53 ~LayoutState(); | 53 ~LayoutState(); |
54 | 54 |
55 void clearPaginationInformation(); | 55 void clearPaginationInformation(); |
56 bool isPaginatingColumns() const { return m_columnInfo; } | 56 bool isPaginatingColumns() const { return m_columnInfo; } |
57 bool isPaginated() const { return m_isPaginated; } | 57 bool isPaginated() const { return m_isPaginated; } |
| 58 bool isClipped() const { return m_clipped; } |
58 | 59 |
59 // The page logical offset is the object's offset from the top of the page i
n the page progression | 60 // The page logical offset is the object's offset from the top of the page i
n the page progression |
60 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | 61 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
61 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; | 62 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; |
62 | 63 |
63 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); | 64 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); |
64 | 65 |
65 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } | 66 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } |
66 | 67 |
67 const LayoutSize& layoutOffset() const { return m_layoutOffset; } | 68 const LayoutSize& layoutOffset() const { return m_layoutOffset; } |
68 const LayoutSize& pageOffset() const { return m_pageOffset; } | 69 const LayoutSize& pageOffset() const { return m_pageOffset; } |
69 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } | 70 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } |
70 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } | 71 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } |
71 | 72 |
72 LayoutState* next() const { return m_next; } | 73 LayoutState* next() const { return m_next; } |
73 | 74 |
74 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } | 75 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } |
75 | 76 |
76 ColumnInfo* columnInfo() const { return m_columnInfo; } | 77 ColumnInfo* columnInfo() const { return m_columnInfo; } |
77 | 78 |
| 79 bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; } |
| 80 |
| 81 const LayoutRect& clipRect() const |
| 82 { |
| 83 ASSERT(m_cachedOffsetsEnabled); |
| 84 return m_clipRect; |
| 85 } |
| 86 const LayoutSize& paintOffset() const |
| 87 { |
| 88 ASSERT(m_cachedOffsetsEnabled); |
| 89 return m_paintOffset; |
| 90 } |
| 91 |
78 RenderObject& renderer() const { return m_renderer; } | 92 RenderObject& renderer() const { return m_renderer; } |
79 | 93 |
80 private: | 94 private: |
81 friend class ForceHorriblySlowRectMapping; | 95 friend class ForceHorriblySlowRectMapping; |
82 | 96 |
83 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 | 97 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 |
84 bool m_isPaginated : 1; | 98 bool m_clipped:1; |
| 99 bool m_isPaginated:1; |
85 // If our page height has changed, this will force all blocks to relayout. | 100 // If our page height has changed, this will force all blocks to relayout. |
86 bool m_pageLogicalHeightChanged : 1; | 101 bool m_pageLogicalHeightChanged:1; |
87 | 102 |
| 103 bool m_cachedOffsetsEnabled:1; |
88 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. | 104 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. |
89 ColumnInfo* m_columnInfo; | 105 ColumnInfo* m_columnInfo; |
90 LayoutState* m_next; | 106 LayoutState* m_next; |
91 | 107 |
| 108 // FIXME: Distinguish between the layout clip rect and the paint clip rect w
hich may be larger, |
| 109 // e.g., because of composited scrolling. |
| 110 LayoutRect m_clipRect; |
| 111 |
| 112 // x/y offset from container. Includes relative positioning and scroll offse
ts. |
| 113 LayoutSize m_paintOffset; |
92 // x/y offset from container. Does not include relative positioning or scrol
l offsets. | 114 // x/y offset from container. Does not include relative positioning or scrol
l offsets. |
93 LayoutSize m_layoutOffset; | 115 LayoutSize m_layoutOffset; |
94 | 116 |
95 // The current page height for the pagination model that encloses us. | 117 // The current page height for the pagination model that encloses us. |
96 LayoutUnit m_pageLogicalHeight; | 118 LayoutUnit m_pageLogicalHeight; |
97 // The offset of the start of the first page in the nearest enclosing pagina
tion model. | 119 // The offset of the start of the first page in the nearest enclosing pagina
tion model. |
98 LayoutSize m_pageOffset; | 120 LayoutSize m_pageOffset; |
99 | 121 |
100 RenderObject& m_renderer; | 122 RenderObject& m_renderer; |
101 }; | 123 }; |
102 | 124 |
103 } // namespace WebCore | 125 } // namespace WebCore |
104 | 126 |
105 #endif // LayoutState_h | 127 #endif // LayoutState_h |
OLD | NEW |