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 ExclusionShapeInsideInfo; | 40 class ExclusionShapeInsideInfo; |
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 void destroy(); |
69 | 68 |
70 // Overloaded new operator. | 69 #if ENABLE(PARTITION_ALLOC) |
71 void* operator new(size_t, RenderArena*); | 70 void* operator new(size_t); |
72 | 71 #endif |
73 // Overridden to prevent the normal delete from being called. | |
74 void operator delete(void*, size_t); | |
75 | 72 |
76 void clearPaginationInformation(); | 73 void clearPaginationInformation(); |
77 bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->pagi
nationUnit() == ColumnInfo::Column; } | 74 bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->pagi
nationUnit() == ColumnInfo::Column; } |
78 bool isPaginated() const { return m_isPaginated; } | 75 bool isPaginated() const { return m_isPaginated; } |
79 | 76 |
80 // The page logical offset is the object's offset from the top of the page i
n the page progression | 77 // 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). | 78 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
82 LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) cons
t; | 79 LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) cons
t; |
83 | 80 |
84 void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset); | 81 void addForcedColumnBreak(RenderBox*, LayoutUnit childLogicalOffset); |
85 | 82 |
86 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } | 83 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } |
87 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } | 84 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } |
88 | 85 |
89 RenderBlock* lineGrid() const { return m_lineGrid; } | 86 RenderBlock* lineGrid() const { return m_lineGrid; } |
90 LayoutSize lineGridOffset() const { return m_lineGridOffset; } | 87 LayoutSize lineGridOffset() const { return m_lineGridOffset; } |
91 LayoutSize lineGridPaginationOrigin() const { return m_lineGridPaginationOri
gin; } | 88 LayoutSize lineGridPaginationOrigin() const { return m_lineGridPaginationOri
gin; } |
92 | 89 |
93 LayoutSize layoutOffset() const { return m_layoutOffset; } | 90 LayoutSize layoutOffset() const { return m_layoutOffset; } |
94 | 91 |
95 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid
|| (m_isPaginated && m_pageLogicalHeight); } | 92 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid
|| (m_isPaginated && m_pageLogicalHeight); } |
96 | 93 |
97 ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const { return m_exclus
ionShapeInsideInfo; } | 94 ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const { return m_exclus
ionShapeInsideInfo; } |
98 private: | 95 private: |
99 // The normal operator new is disallowed. | 96 #if ENABLE(PARTITION_ALLOC) |
100 void* operator new(size_t) throw(); | 97 void operator delete(void*); |
| 98 #endif |
101 | 99 |
102 void propagateLineGridInfo(RenderBox*); | 100 void propagateLineGridInfo(RenderBox*); |
103 void establishLineGrid(RenderBlock*); | 101 void establishLineGrid(RenderBlock*); |
104 | 102 |
105 void computeLineGridPaginationOrigin(RenderBox*); | 103 void computeLineGridPaginationOrigin(RenderBox*); |
106 | 104 |
107 public: | 105 public: |
108 // Do not add anything apart from bitfields until after m_columnInfo. See ht
tps://bugs.webkit.org/show_bug.cgi?id=100173 | 106 // 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; | 107 bool m_clipped:1; |
110 bool m_isPaginated:1; | 108 bool m_isPaginated:1; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 LayoutSize m_lineGridPaginationOrigin; | 140 LayoutSize m_lineGridPaginationOrigin; |
143 | 141 |
144 #ifndef NDEBUG | 142 #ifndef NDEBUG |
145 RenderObject* m_renderer; | 143 RenderObject* m_renderer; |
146 #endif | 144 #endif |
147 }; | 145 }; |
148 | 146 |
149 } // namespace WebCore | 147 } // namespace WebCore |
150 | 148 |
151 #endif // LayoutState_h | 149 #endif // LayoutState_h |
OLD | NEW |