OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 10 matching lines...) Expand all Loading... |
21 */ | 21 */ |
22 | 22 |
23 #ifndef LayoutBox_h | 23 #ifndef LayoutBox_h |
24 #define LayoutBox_h | 24 #define LayoutBox_h |
25 | 25 |
26 #include "core/CoreExport.h" | 26 #include "core/CoreExport.h" |
27 #include "core/layout/LayoutBoxModelObject.h" | 27 #include "core/layout/LayoutBoxModelObject.h" |
28 #include "core/layout/OverflowModel.h" | 28 #include "core/layout/OverflowModel.h" |
29 #include "core/layout/ScrollEnums.h" | 29 #include "core/layout/ScrollEnums.h" |
30 #include "platform/scroll/ScrollTypes.h" | 30 #include "platform/scroll/ScrollTypes.h" |
31 #include "wtf/PtrUtil.h" | |
32 #include <memory> | |
33 | 31 |
34 namespace blink { | 32 namespace blink { |
35 | 33 |
36 class LayoutBlockFlow; | 34 class LayoutBlockFlow; |
37 class LayoutMultiColumnSpannerPlaceholder; | 35 class LayoutMultiColumnSpannerPlaceholder; |
38 class ShapeOutsideInfo; | 36 class ShapeOutsideInfo; |
39 | 37 |
40 struct PaintInfo; | 38 struct PaintInfo; |
41 | 39 |
42 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; | 40 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 80 |
83 LayoutUnit m_pageLogicalOffset; | 81 LayoutUnit m_pageLogicalOffset; |
84 | 82 |
85 LayoutUnit m_paginationStrut; | 83 LayoutUnit m_paginationStrut; |
86 | 84 |
87 LayoutBlock* m_percentHeightContainer; | 85 LayoutBlock* m_percentHeightContainer; |
88 // For snap area, the owning snap container. | 86 // For snap area, the owning snap container. |
89 LayoutBox* m_snapContainer; | 87 LayoutBox* m_snapContainer; |
90 // For snap container, the descendant snap areas that contribute snap | 88 // For snap container, the descendant snap areas that contribute snap |
91 // points. | 89 // points. |
92 std::unique_ptr<SnapAreaSet> m_snapAreas; | 90 OwnPtr<SnapAreaSet> m_snapAreas; |
93 | 91 |
94 SnapAreaSet& ensureSnapAreas() | 92 SnapAreaSet& ensureSnapAreas() |
95 { | 93 { |
96 if (!m_snapAreas) | 94 if (!m_snapAreas) |
97 m_snapAreas = wrapUnique(new SnapAreaSet); | 95 m_snapAreas = adoptPtr(new SnapAreaSet); |
98 | 96 |
99 return *m_snapAreas; | 97 return *m_snapAreas; |
100 } | 98 } |
101 }; | 99 }; |
102 | 100 |
103 // LayoutBox implements the full CSS box model. | 101 // LayoutBox implements the full CSS box model. |
104 // | 102 // |
105 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and | 103 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and |
106 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the | 104 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the |
107 // rectangle and offset forming the CSS box (m_frameRect) and the getters for | 105 // rectangle and offset forming the CSS box (m_frameRect) and the getters for |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the | 1052 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the |
1055 // boolean before returning. | 1053 // boolean before returning. |
1056 // | 1054 // |
1057 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more | 1055 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more |
1058 // details about those widths. | 1056 // details about those widths. |
1059 virtual void computePreferredLogicalWidths() { clearPreferredLogicalWidthsDi
rty(); } | 1057 virtual void computePreferredLogicalWidths() { clearPreferredLogicalWidthsDi
rty(); } |
1060 | 1058 |
1061 LayoutBoxRareData& ensureRareData() | 1059 LayoutBoxRareData& ensureRareData() |
1062 { | 1060 { |
1063 if (!m_rareData) | 1061 if (!m_rareData) |
1064 m_rareData = wrapUnique(new LayoutBoxRareData()); | 1062 m_rareData = adoptPtr(new LayoutBoxRareData()); |
1065 return *m_rareData.get(); | 1063 return *m_rareData.get(); |
1066 } | 1064 } |
1067 | 1065 |
1068 bool needToSavePreviousBoxSizes(); | 1066 bool needToSavePreviousBoxSizes(); |
1069 void savePreviousBoxSizesIfNeeded(); | 1067 void savePreviousBoxSizesIfNeeded(); |
1070 LayoutSize computePreviousBorderBoxSize(const LayoutSize& previousBoundsSize
) const; | 1068 LayoutSize computePreviousBorderBoxSize(const LayoutSize& previousBoundsSize
) const; |
1071 | 1069 |
1072 bool logicalHeightComputesAsNone(SizeType) const; | 1070 bool logicalHeightComputesAsNone(SizeType) const; |
1073 | 1071 |
1074 bool isBox() const = delete; // This will catch anyone doing an unnecessary
check. | 1072 bool isBox() const = delete; // This will catch anyone doing an unnecessary
check. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 // | 1115 // |
1118 // See LayoutObject::minPreferredLogicalWidth() for more details. | 1116 // See LayoutObject::minPreferredLogicalWidth() for more details. |
1119 LayoutUnit m_minPreferredLogicalWidth; | 1117 LayoutUnit m_minPreferredLogicalWidth; |
1120 | 1118 |
1121 // The logical width of the element if it never breaks any lines at all. | 1119 // The logical width of the element if it never breaks any lines at all. |
1122 // | 1120 // |
1123 // See LayoutObject::maxPreferredLogicalWidth() for more details. | 1121 // See LayoutObject::maxPreferredLogicalWidth() for more details. |
1124 LayoutUnit m_maxPreferredLogicalWidth; | 1122 LayoutUnit m_maxPreferredLogicalWidth; |
1125 | 1123 |
1126 // Our overflow information. | 1124 // Our overflow information. |
1127 std::unique_ptr<BoxOverflowModel> m_overflow; | 1125 OwnPtr<BoxOverflowModel> m_overflow; |
1128 | 1126 |
1129 private: | 1127 private: |
1130 // The inline box containing this LayoutBox, for atomic inline elements. | 1128 // The inline box containing this LayoutBox, for atomic inline elements. |
1131 InlineBox* m_inlineBoxWrapper; | 1129 InlineBox* m_inlineBoxWrapper; |
1132 | 1130 |
1133 std::unique_ptr<LayoutBoxRareData> m_rareData; | 1131 OwnPtr<LayoutBoxRareData> m_rareData; |
1134 }; | 1132 }; |
1135 | 1133 |
1136 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBox, isBox()); | 1134 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBox, isBox()); |
1137 | 1135 |
1138 inline LayoutBox* LayoutBox::previousSiblingBox() const | 1136 inline LayoutBox* LayoutBox::previousSiblingBox() const |
1139 { | 1137 { |
1140 return toLayoutBox(previousSibling()); | 1138 return toLayoutBox(previousSibling()); |
1141 } | 1139 } |
1142 | 1140 |
1143 inline LayoutBox* LayoutBox::previousInFlowSiblingBox() const | 1141 inline LayoutBox* LayoutBox::previousInFlowSiblingBox() const |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 || breakValue == BreakLeft | 1218 || breakValue == BreakLeft |
1221 || breakValue == BreakPage | 1219 || breakValue == BreakPage |
1222 || breakValue == BreakRecto | 1220 || breakValue == BreakRecto |
1223 || breakValue == BreakRight | 1221 || breakValue == BreakRight |
1224 || breakValue == BreakVerso; | 1222 || breakValue == BreakVerso; |
1225 } | 1223 } |
1226 | 1224 |
1227 } // namespace blink | 1225 } // namespace blink |
1228 | 1226 |
1229 #endif // LayoutBox_h | 1227 #endif // LayoutBox_h |
OLD | NEW |