| 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; } | |
| 59 | 58 |
| 60 // The page logical offset is the object's offset from the top of the page i
n the page progression | 59 // The page logical offset is the object's offset from the top of the page i
n the page progression |
| 61 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | 60 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
| 62 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; | 61 LayoutUnit pageLogicalOffset(const RenderBox&, const LayoutUnit& childLogica
lOffset) const; |
| 63 | 62 |
| 64 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); | 63 void addForcedColumnBreak(const RenderBox&, const LayoutUnit& childLogicalOf
fset); |
| 65 | 64 |
| 66 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } | 65 void setColumnInfo(ColumnInfo* columnInfo) { m_columnInfo = columnInfo; } |
| 67 | 66 |
| 68 const LayoutSize& layoutOffset() const { return m_layoutOffset; } | 67 const LayoutSize& layoutOffset() const { return m_layoutOffset; } |
| 69 const LayoutSize& pageOffset() const { return m_pageOffset; } | 68 const LayoutSize& pageOffset() const { return m_pageOffset; } |
| 70 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } | 69 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } |
| 71 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } | 70 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } |
| 72 | 71 |
| 73 LayoutState* next() const { return m_next; } | 72 LayoutState* next() const { return m_next; } |
| 74 | 73 |
| 75 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } | 74 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_isPaginat
ed && m_pageLogicalHeight; } |
| 76 | 75 |
| 77 ColumnInfo* columnInfo() const { return m_columnInfo; } | 76 ColumnInfo* columnInfo() const { return m_columnInfo; } |
| 78 | 77 |
| 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 | |
| 92 RenderObject& renderer() const { return m_renderer; } | 78 RenderObject& renderer() const { return m_renderer; } |
| 93 | 79 |
| 94 private: | 80 private: |
| 95 friend class ForceHorriblySlowRectMapping; | 81 friend class ForceHorriblySlowRectMapping; |
| 96 | 82 |
| 97 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 | 83 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 |
| 98 bool m_clipped:1; | 84 bool m_isPaginated : 1; |
| 99 bool m_isPaginated:1; | |
| 100 // If our page height has changed, this will force all blocks to relayout. | 85 // If our page height has changed, this will force all blocks to relayout. |
| 101 bool m_pageLogicalHeightChanged:1; | 86 bool m_pageLogicalHeightChanged : 1; |
| 102 | 87 |
| 103 bool m_cachedOffsetsEnabled:1; | |
| 104 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. | 88 // If the enclosing pagination model is a column model, then this will store
column information for easy retrieval/manipulation. |
| 105 ColumnInfo* m_columnInfo; | 89 ColumnInfo* m_columnInfo; |
| 106 LayoutState* m_next; | 90 LayoutState* m_next; |
| 107 | 91 |
| 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; | |
| 114 // x/y offset from container. Does not include relative positioning or scrol
l offsets. | 92 // x/y offset from container. Does not include relative positioning or scrol
l offsets. |
| 115 LayoutSize m_layoutOffset; | 93 LayoutSize m_layoutOffset; |
| 116 | 94 |
| 117 // The current page height for the pagination model that encloses us. | 95 // The current page height for the pagination model that encloses us. |
| 118 LayoutUnit m_pageLogicalHeight; | 96 LayoutUnit m_pageLogicalHeight; |
| 119 // The offset of the start of the first page in the nearest enclosing pagina
tion model. | 97 // The offset of the start of the first page in the nearest enclosing pagina
tion model. |
| 120 LayoutSize m_pageOffset; | 98 LayoutSize m_pageOffset; |
| 121 | 99 |
| 122 RenderObject& m_renderer; | 100 RenderObject& m_renderer; |
| 123 }; | 101 }; |
| 124 | 102 |
| 125 } // namespace WebCore | 103 } // namespace WebCore |
| 126 | 104 |
| 127 #endif // LayoutState_h | 105 #endif // LayoutState_h |
| OLD | NEW |