| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef LayoutState_h | 26 #ifndef LayoutState_h |
| 27 #define LayoutState_h | 27 #define LayoutState_h |
| 28 | 28 |
| 29 #include "core/platform/graphics/LayoutRect.h" | 29 #include "core/platform/graphics/LayoutRect.h" |
| 30 #include "core/rendering/ColumnInfo.h" | 30 #include "core/rendering/ColumnInfo.h" |
| 31 #include "wtf/HashMap.h" | 31 #include "wtf/HashMap.h" |
| 32 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class RenderArena; | |
| 37 class RenderBlock; | 36 class RenderBlock; |
| 38 class RenderBox; | 37 class RenderBox; |
| 39 class RenderObject; | 38 class RenderObject; |
| 40 class RenderFlowThread; | 39 class RenderFlowThread; |
| 41 class ShapeInsideInfo; | 40 class ShapeInsideInfo; |
| 42 | 41 |
| 43 class LayoutState { | 42 class LayoutState { |
| 44 WTF_MAKE_NONCOPYABLE(LayoutState); | 43 WTF_MAKE_NONCOPYABLE(LayoutState); |
| 45 public: | 44 public: |
| 46 LayoutState() | 45 LayoutState() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 , m_pageLogicalHeight(0) | 57 , m_pageLogicalHeight(0) |
| 59 #ifndef NDEBUG | 58 #ifndef NDEBUG |
| 60 , m_renderer(0) | 59 , m_renderer(0) |
| 61 #endif | 60 #endif |
| 62 { | 61 { |
| 63 } | 62 } |
| 64 | 63 |
| 65 LayoutState(LayoutState*, RenderBox*, const LayoutSize& offset, LayoutUnit p
ageHeight, bool pageHeightChanged, ColumnInfo*); | 64 LayoutState(LayoutState*, RenderBox*, const LayoutSize& offset, LayoutUnit p
ageHeight, bool pageHeightChanged, ColumnInfo*); |
| 66 LayoutState(RenderObject*); | 65 LayoutState(RenderObject*); |
| 67 | 66 |
| 68 void destroy(RenderArena*); | 67 // LayoutState is allocated out of the rendering partition. |
| 69 | 68 void* operator new(size_t); |
| 70 // Overloaded new operator. | 69 void operator delete(void*); |
| 71 void* operator new(size_t, RenderArena*); | |
| 72 | |
| 73 // Overridden to prevent the normal delete from being called. | |
| 74 void operator delete(void*, size_t); | |
| 75 | 70 |
| 76 void clearPaginationInformation(); | 71 void clearPaginationInformation(); |
| 77 bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->pagi
nationUnit() == ColumnInfo::Column; } | 72 bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->pagi
nationUnit() == ColumnInfo::Column; } |
| 78 bool isPaginated() const { return m_isPaginated; } | 73 bool isPaginated() const { return m_isPaginated; } |
| 79 | 74 |
| 80 // The page logical offset is the object's offset from the top of the page i
n the page progression | 75 // The page logical offset is the object's offset from the top of the page i
n the page progression |
| 81 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | 76 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
| 82 LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) cons
t; | 77 LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) cons
t; |
| 83 | 78 |
| 84 void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset); | 79 void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset); |
| 85 | 80 |
| 86 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } | 81 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } |
| 87 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } | 82 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } |
| 88 | 83 |
| 89 RenderBlock* lineGrid() const { return m_lineGrid; } | 84 RenderBlock* lineGrid() const { return m_lineGrid; } |
| 90 LayoutSize lineGridOffset() const { return m_lineGridOffset; } | 85 LayoutSize lineGridOffset() const { return m_lineGridOffset; } |
| 91 LayoutSize lineGridPaginationOrigin() const { return m_lineGridPaginationOri
gin; } | 86 LayoutSize lineGridPaginationOrigin() const { return m_lineGridPaginationOri
gin; } |
| 92 | 87 |
| 93 LayoutSize layoutOffset() const { return m_layoutOffset; } | 88 LayoutSize layoutOffset() const { return m_layoutOffset; } |
| 94 | 89 |
| 95 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid
|| (m_isPaginated && m_pageLogicalHeight); } | 90 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid
|| (m_isPaginated && m_pageLogicalHeight); } |
| 96 | 91 |
| 97 ShapeInsideInfo* shapeInsideInfo() const { return m_shapeInsideInfo; } | 92 ShapeInsideInfo* shapeInsideInfo() const { return m_shapeInsideInfo; } |
| 98 private: | 93 private: |
| 99 // The normal operator new is disallowed. | |
| 100 void* operator new(size_t) throw(); | |
| 101 | |
| 102 void propagateLineGridInfo(RenderBox*); | 94 void propagateLineGridInfo(RenderBox*); |
| 103 void establishLineGrid(RenderBlock*); | 95 void establishLineGrid(RenderBlock*); |
| 104 | 96 |
| 105 void computeLineGridPaginationOrigin(RenderBox*); | 97 void computeLineGridPaginationOrigin(RenderBox*); |
| 106 | 98 |
| 107 public: | 99 public: |
| 108 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 | 100 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 |
| 109 bool m_clipped:1; | 101 bool m_clipped:1; |
| 110 bool m_isPaginated:1; | 102 bool m_isPaginated:1; |
| 111 // If our page height has changed, this will force all blocks to relayout. | 103 // If our page height has changed, this will force all blocks to relayout. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 142 LayoutSize m_lineGridPaginationOrigin; | 134 LayoutSize m_lineGridPaginationOrigin; |
| 143 | 135 |
| 144 #ifndef NDEBUG | 136 #ifndef NDEBUG |
| 145 RenderObject* m_renderer; | 137 RenderObject* m_renderer; |
| 146 #endif | 138 #endif |
| 147 }; | 139 }; |
| 148 | 140 |
| 149 } // namespace WebCore | 141 } // namespace WebCore |
| 150 | 142 |
| 151 #endif // LayoutState_h | 143 #endif // LayoutState_h |
| OLD | NEW |