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> |
31 | 33 |
32 namespace blink { | 34 namespace blink { |
33 | 35 |
34 class LayoutBlockFlow; | 36 class LayoutBlockFlow; |
35 class LayoutMultiColumnSpannerPlaceholder; | 37 class LayoutMultiColumnSpannerPlaceholder; |
36 class ShapeOutsideInfo; | 38 class ShapeOutsideInfo; |
37 | 39 |
38 struct PaintInfo; | 40 struct PaintInfo; |
39 | 41 |
40 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; | 42 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 LayoutUnit m_pageLogicalOffset; | 83 LayoutUnit m_pageLogicalOffset; |
82 | 84 |
83 LayoutUnit m_paginationStrut; | 85 LayoutUnit m_paginationStrut; |
84 | 86 |
85 LayoutBlock* m_percentHeightContainer; | 87 LayoutBlock* m_percentHeightContainer; |
86 // For snap area, the owning snap container. | 88 // For snap area, the owning snap container. |
87 LayoutBox* m_snapContainer; | 89 LayoutBox* m_snapContainer; |
88 // For snap container, the descendant snap areas that contribute snap | 90 // For snap container, the descendant snap areas that contribute snap |
89 // points. | 91 // points. |
90 OwnPtr<SnapAreaSet> m_snapAreas; | 92 std::unique_ptr<SnapAreaSet> m_snapAreas; |
91 | 93 |
92 SnapAreaSet& ensureSnapAreas() | 94 SnapAreaSet& ensureSnapAreas() |
93 { | 95 { |
94 if (!m_snapAreas) | 96 if (!m_snapAreas) |
95 m_snapAreas = adoptPtr(new SnapAreaSet); | 97 m_snapAreas = wrapUnique(new SnapAreaSet); |
96 | 98 |
97 return *m_snapAreas; | 99 return *m_snapAreas; |
98 } | 100 } |
99 }; | 101 }; |
100 | 102 |
101 // LayoutBox implements the full CSS box model. | 103 // LayoutBox implements the full CSS box model. |
102 // | 104 // |
103 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and | 105 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and |
104 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the | 106 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the |
105 // rectangle and offset forming the CSS box (m_frameRect) and the getters for | 107 // 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... |
1052 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the | 1054 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the |
1053 // boolean before returning. | 1055 // boolean before returning. |
1054 // | 1056 // |
1055 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more | 1057 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more |
1056 // details about those widths. | 1058 // details about those widths. |
1057 virtual void computePreferredLogicalWidths() { clearPreferredLogicalWidthsDi
rty(); } | 1059 virtual void computePreferredLogicalWidths() { clearPreferredLogicalWidthsDi
rty(); } |
1058 | 1060 |
1059 LayoutBoxRareData& ensureRareData() | 1061 LayoutBoxRareData& ensureRareData() |
1060 { | 1062 { |
1061 if (!m_rareData) | 1063 if (!m_rareData) |
1062 m_rareData = adoptPtr(new LayoutBoxRareData()); | 1064 m_rareData = wrapUnique(new LayoutBoxRareData()); |
1063 return *m_rareData.get(); | 1065 return *m_rareData.get(); |
1064 } | 1066 } |
1065 | 1067 |
1066 bool needToSavePreviousBoxSizes(); | 1068 bool needToSavePreviousBoxSizes(); |
1067 void savePreviousBoxSizesIfNeeded(); | 1069 void savePreviousBoxSizesIfNeeded(); |
1068 LayoutSize computePreviousBorderBoxSize(const LayoutSize& previousBoundsSize
) const; | 1070 LayoutSize computePreviousBorderBoxSize(const LayoutSize& previousBoundsSize
) const; |
1069 | 1071 |
1070 bool logicalHeightComputesAsNone(SizeType) const; | 1072 bool logicalHeightComputesAsNone(SizeType) const; |
1071 | 1073 |
1072 bool isBox() const = delete; // This will catch anyone doing an unnecessary
check. | 1074 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... |
1115 // | 1117 // |
1116 // See LayoutObject::minPreferredLogicalWidth() for more details. | 1118 // See LayoutObject::minPreferredLogicalWidth() for more details. |
1117 LayoutUnit m_minPreferredLogicalWidth; | 1119 LayoutUnit m_minPreferredLogicalWidth; |
1118 | 1120 |
1119 // The logical width of the element if it never breaks any lines at all. | 1121 // The logical width of the element if it never breaks any lines at all. |
1120 // | 1122 // |
1121 // See LayoutObject::maxPreferredLogicalWidth() for more details. | 1123 // See LayoutObject::maxPreferredLogicalWidth() for more details. |
1122 LayoutUnit m_maxPreferredLogicalWidth; | 1124 LayoutUnit m_maxPreferredLogicalWidth; |
1123 | 1125 |
1124 // Our overflow information. | 1126 // Our overflow information. |
1125 OwnPtr<BoxOverflowModel> m_overflow; | 1127 std::unique_ptr<BoxOverflowModel> m_overflow; |
1126 | 1128 |
1127 private: | 1129 private: |
1128 // The inline box containing this LayoutBox, for atomic inline elements. | 1130 // The inline box containing this LayoutBox, for atomic inline elements. |
1129 InlineBox* m_inlineBoxWrapper; | 1131 InlineBox* m_inlineBoxWrapper; |
1130 | 1132 |
1131 OwnPtr<LayoutBoxRareData> m_rareData; | 1133 std::unique_ptr<LayoutBoxRareData> m_rareData; |
1132 }; | 1134 }; |
1133 | 1135 |
1134 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBox, isBox()); | 1136 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBox, isBox()); |
1135 | 1137 |
1136 inline LayoutBox* LayoutBox::previousSiblingBox() const | 1138 inline LayoutBox* LayoutBox::previousSiblingBox() const |
1137 { | 1139 { |
1138 return toLayoutBox(previousSibling()); | 1140 return toLayoutBox(previousSibling()); |
1139 } | 1141 } |
1140 | 1142 |
1141 inline LayoutBox* LayoutBox::previousInFlowSiblingBox() const | 1143 inline LayoutBox* LayoutBox::previousInFlowSiblingBox() const |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 || breakValue == BreakLeft | 1220 || breakValue == BreakLeft |
1219 || breakValue == BreakPage | 1221 || breakValue == BreakPage |
1220 || breakValue == BreakRecto | 1222 || breakValue == BreakRecto |
1221 || breakValue == BreakRight | 1223 || breakValue == BreakRight |
1222 || breakValue == BreakVerso; | 1224 || breakValue == BreakVerso; |
1223 } | 1225 } |
1224 | 1226 |
1225 } // namespace blink | 1227 } // namespace blink |
1226 | 1228 |
1227 #endif // LayoutBox_h | 1229 #endif // LayoutBox_h |
OLD | NEW |