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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #ifndef SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ | 21 #ifndef SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ |
22 #define SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ | 22 #define SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ |
23 | 23 |
24 #include "sky/engine/core/rendering/InlineFlowBox.h" | 24 #include "sky/engine/core/rendering/InlineFlowBox.h" |
25 #include "sky/engine/platform/text/BidiContext.h" | 25 #include "sky/engine/platform/text/BidiContext.h" |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 | 28 |
29 class EllipsisBox; | 29 class EllipsisBox; |
30 class HitTestResult; | 30 class HitTestResult; |
31 class RenderBlockFlow; | 31 class RenderParagraph; |
32 | 32 |
33 struct BidiStatus; | 33 struct BidiStatus; |
34 struct GapRects; | 34 struct GapRects; |
35 | 35 |
36 class RootInlineBox : public InlineFlowBox { | 36 class RootInlineBox : public InlineFlowBox { |
37 public: | 37 public: |
38 explicit RootInlineBox(RenderBlockFlow&); | 38 explicit RootInlineBox(RenderParagraph&); |
39 | 39 |
40 virtual void destroy() override final; | 40 virtual void destroy() override final; |
41 | 41 |
42 virtual bool isRootInlineBox() const override final { return true; } | 42 virtual bool isRootInlineBox() const override final { return true; } |
43 | 43 |
44 void detachEllipsisBox(); | 44 void detachEllipsisBox(); |
45 | 45 |
46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } | 46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } |
47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } | 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } |
48 | 48 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 using InlineBox::hasSelectedChildren; | 115 using InlineBox::hasSelectedChildren; |
116 using InlineBox::setHasSelectedChildren; | 116 using InlineBox::setHasSelectedChildren; |
117 | 117 |
118 virtual RenderObject::SelectionState selectionState() override final; | 118 virtual RenderObject::SelectionState selectionState() override final; |
119 InlineBox* firstSelectedBox(); | 119 InlineBox* firstSelectedBox(); |
120 InlineBox* lastSelectedBox(); | 120 InlineBox* lastSelectedBox(); |
121 | 121 |
122 GapRects lineSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlo
ckPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selTop, La
youtUnit selHeight, const PaintInfo*); | 122 GapRects lineSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlo
ckPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selTop, La
youtUnit selHeight, const PaintInfo*); |
123 | 123 |
124 RenderBlockFlow& block() const; | 124 RenderParagraph& block() const; |
125 | 125 |
126 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); | 126 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); |
127 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); | 127 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); |
128 | 128 |
129 void appendFloat(RenderBox* floatingBox) | |
130 { | |
131 ASSERT(!isDirty()); | |
132 if (m_floats) | |
133 m_floats->append(floatingBox); | |
134 else | |
135 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); | |
136 } | |
137 | |
138 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} | |
139 | |
140 virtual void extractLineBoxFromRenderObject() override final; | 129 virtual void extractLineBoxFromRenderObject() override final; |
141 virtual void attachLineBoxToRenderObject() override final; | 130 virtual void attachLineBoxToRenderObject() override final; |
142 virtual void removeLineBoxFromRenderObject() override final; | 131 virtual void removeLineBoxFromRenderObject() override final; |
143 | 132 |
144 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } | 133 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } |
145 | 134 |
146 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } | 135 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } |
147 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } | 136 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } |
148 | 137 |
149 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; | 138 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 { | 201 { |
213 | 202 |
214 } | 203 } |
215 | 204 |
216 LayoutUnit m_paginatedLineWidth; | 205 LayoutUnit m_paginatedLineWidth; |
217 bool m_isFirstAfterPageBreak; | 206 bool m_isFirstAfterPageBreak; |
218 }; | 207 }; |
219 | 208 |
220 OwnPtr<LineFragmentationData> m_fragmentationData; | 209 OwnPtr<LineFragmentationData> m_fragmentationData; |
221 | 210 |
222 // Floats hanging off the line are pushed into this vector during layout. It
is only | |
223 // good for as long as the line has not been marked dirty. | |
224 OwnPtr<Vector<RenderBox*> > m_floats; | |
225 | |
226 LayoutUnit m_lineTop; | 211 LayoutUnit m_lineTop; |
227 LayoutUnit m_lineBottom; | 212 LayoutUnit m_lineBottom; |
228 LayoutUnit m_lineTopWithLeading; | 213 LayoutUnit m_lineTopWithLeading; |
229 LayoutUnit m_lineBottomWithLeading; | 214 LayoutUnit m_lineBottomWithLeading; |
230 LayoutUnit m_selectionBottom; | 215 LayoutUnit m_selectionBottom; |
231 }; | 216 }; |
232 | 217 |
233 } // namespace blink | 218 } // namespace blink |
234 | 219 |
235 #endif // SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ | 220 #endif // SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_ |
OLD | NEW |