OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef RootInlineBox_h | 21 #ifndef RootInlineBox_h |
22 #define RootInlineBox_h | 22 #define RootInlineBox_h |
23 | 23 |
24 #include "core/layout/api/LineLayoutItem.h" | 24 #include "core/layout/api/LineLayoutItem.h" |
25 #include "core/layout/api/SelectionState.h" | 25 #include "core/layout/api/SelectionState.h" |
26 #include "core/layout/line/InlineFlowBox.h" | 26 #include "core/layout/line/InlineFlowBox.h" |
27 #include "platform/text/BidiContext.h" | 27 #include "platform/text/BidiContext.h" |
| 28 #include "wtf/PtrUtil.h" |
| 29 #include <memory> |
28 | 30 |
29 namespace blink { | 31 namespace blink { |
30 | 32 |
31 class EllipsisBox; | 33 class EllipsisBox; |
32 class HitTestResult; | 34 class HitTestResult; |
33 class LineLayoutBlockFlow; | 35 class LineLayoutBlockFlow; |
34 | 36 |
35 struct BidiStatus; | 37 struct BidiStatus; |
36 struct GapRects; | 38 struct GapRects; |
37 | 39 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 119 |
118 InlineBox* closestLeafChildForPoint(const LayoutPoint&, bool onlyEditableLea
ves); | 120 InlineBox* closestLeafChildForPoint(const LayoutPoint&, bool onlyEditableLea
ves); |
119 InlineBox* closestLeafChildForLogicalLeftPosition(LayoutUnit, bool onlyEdita
bleLeaves = false); | 121 InlineBox* closestLeafChildForLogicalLeftPosition(LayoutUnit, bool onlyEdita
bleLeaves = false); |
120 | 122 |
121 void appendFloat(LayoutBox* floatingBox) | 123 void appendFloat(LayoutBox* floatingBox) |
122 { | 124 { |
123 ASSERT(!isDirty()); | 125 ASSERT(!isDirty()); |
124 if (m_floats) | 126 if (m_floats) |
125 m_floats->append(floatingBox); | 127 m_floats->append(floatingBox); |
126 else | 128 else |
127 m_floats= adoptPtr(new Vector<LayoutBox*>(1, floatingBox)); | 129 m_floats= wrapUnique(new Vector<LayoutBox*>(1, floatingBox)); |
128 } | 130 } |
129 | 131 |
130 Vector<LayoutBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} | 132 Vector<LayoutBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} |
131 | 133 |
132 void extractLineBoxFromLayoutObject() final; | 134 void extractLineBoxFromLayoutObject() final; |
133 void attachLineBoxToLayoutObject() final; | 135 void attachLineBoxToLayoutObject() final; |
134 void removeLineBoxFromLayoutObject() final; | 136 void removeLineBoxFromLayoutObject() final; |
135 | 137 |
136 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } | 138 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } |
137 | 139 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // This folds into the padding at the end of InlineFlowBox on 64-bit. | 177 // This folds into the padding at the end of InlineFlowBox on 64-bit. |
176 unsigned m_lineBreakPos; | 178 unsigned m_lineBreakPos; |
177 | 179 |
178 // Where this line ended. The exact object and the position within that obj
ect are stored so that | 180 // Where this line ended. The exact object and the position within that obj
ect are stored so that |
179 // we can create an InlineIterator beginning just after the end of this line
. | 181 // we can create an InlineIterator beginning just after the end of this line
. |
180 LineLayoutItem m_lineBreakObj; | 182 LineLayoutItem m_lineBreakObj; |
181 RefPtr<BidiContext> m_lineBreakContext; | 183 RefPtr<BidiContext> m_lineBreakContext; |
182 | 184 |
183 // Floats hanging off the line are pushed into this vector during layout. It
is only | 185 // Floats hanging off the line are pushed into this vector during layout. It
is only |
184 // good for as long as the line has not been marked dirty. | 186 // good for as long as the line has not been marked dirty. |
185 OwnPtr<Vector<LayoutBox*>> m_floats; | 187 std::unique_ptr<Vector<LayoutBox*>> m_floats; |
186 | 188 |
187 LayoutUnit m_lineTop; | 189 LayoutUnit m_lineTop; |
188 LayoutUnit m_lineBottom; | 190 LayoutUnit m_lineBottom; |
189 LayoutUnit m_lineTopWithLeading; | 191 LayoutUnit m_lineTopWithLeading; |
190 LayoutUnit m_lineBottomWithLeading; | 192 LayoutUnit m_lineBottomWithLeading; |
191 LayoutUnit m_selectionBottom; | 193 LayoutUnit m_selectionBottom; |
192 LayoutUnit m_paginationStrut; | 194 LayoutUnit m_paginationStrut; |
193 }; | 195 }; |
194 | 196 |
195 } // namespace blink | 197 } // namespace blink |
196 | 198 |
197 #endif // RootInlineBox_h | 199 #endif // RootInlineBox_h |
OLD | NEW |