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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 { | 72 { |
73 m_lineTop = top; | 73 m_lineTop = top; |
74 m_lineBottom = bottom; | 74 m_lineBottom = bottom; |
75 m_lineTopWithLeading = topWithLeading; | 75 m_lineTopWithLeading = topWithLeading; |
76 m_lineBottomWithLeading = bottomWithLeading; | 76 m_lineBottomWithLeading = bottomWithLeading; |
77 m_selectionBottom = selectionBottom == LayoutUnit::min() ? bottom : sele
ctionBottom; | 77 m_selectionBottom = selectionBottom == LayoutUnit::min() ? bottom : sele
ctionBottom; |
78 } | 78 } |
79 | 79 |
80 virtual RenderLineBoxList* rendererLineBoxes() const override final; | 80 virtual RenderLineBoxList* rendererLineBoxes() const override final; |
81 | 81 |
82 RenderObject* lineBreakObj() const { return m_lineBreakObj; } | 82 LayoutObject* lineBreakObj() const { return m_lineBreakObj; } |
83 BidiStatus lineBreakBidiStatus() const; | 83 BidiStatus lineBreakBidiStatus() const; |
84 void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&); | 84 void setLineBreakInfo(LayoutObject*, unsigned breakPos, const BidiStatus&); |
85 | 85 |
86 unsigned lineBreakPos() const { return m_lineBreakPos; } | 86 unsigned lineBreakPos() const { return m_lineBreakPos; } |
87 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } | 87 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } |
88 | 88 |
89 using InlineBox::endsWithBreak; | 89 using InlineBox::endsWithBreak; |
90 using InlineBox::setEndsWithBreak; | 90 using InlineBox::setEndsWithBreak; |
91 | 91 |
92 void childRemoved(InlineBox*); | 92 void childRemoved(InlineBox*); |
93 | 93 |
94 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); | 94 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); |
95 // Return the truncatedWidth, the width of the truncated text + ellipsis. | 95 // Return the truncatedWidth, the width of the truncated text + ellipsis. |
96 FloatWillBeLayoutUnit placeEllipsis(const AtomicString& ellipsisStr, bool lt
r, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, Fl
oatWillBeLayoutUnit ellipsisWidth, InlineBox* markupBox = 0); | 96 FloatWillBeLayoutUnit placeEllipsis(const AtomicString& ellipsisStr, bool lt
r, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, Fl
oatWillBeLayoutUnit ellipsisWidth, InlineBox* markupBox = 0); |
97 // Return the position of the EllipsisBox or -1. | 97 // Return the position of the EllipsisBox or -1. |
98 virtual FloatWillBeLayoutUnit placeEllipsisBox(bool ltr, FloatWillBeLayoutUn
it blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, FloatWillBeLayoutUnit el
lipsisWidth, FloatWillBeLayoutUnit &truncatedWidth, bool& foundBox) override fin
al; | 98 virtual FloatWillBeLayoutUnit placeEllipsisBox(bool ltr, FloatWillBeLayoutUn
it blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, FloatWillBeLayoutUnit el
lipsisWidth, FloatWillBeLayoutUnit &truncatedWidth, bool& foundBox) override fin
al; |
99 | 99 |
100 using InlineBox::hasEllipsisBox; | 100 using InlineBox::hasEllipsisBox; |
101 EllipsisBox* ellipsisBox() const; | 101 EllipsisBox* ellipsisBox() const; |
102 | 102 |
103 virtual void clearTruncation() override final; | 103 virtual void clearTruncation() override final; |
104 | 104 |
105 virtual int baselinePosition(FontBaseline baselineType) const override final
; | 105 virtual int baselinePosition(FontBaseline baselineType) const override final
; |
106 virtual LayoutUnit lineHeight() const override final; | 106 virtual LayoutUnit lineHeight() const override final; |
107 | 107 |
108 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop,
LayoutUnit lineBottom) override; | 108 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop,
LayoutUnit lineBottom) override; |
109 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) override final; | 109 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) override final; |
110 | 110 |
111 using InlineBox::hasSelectedChildren; | 111 using InlineBox::hasSelectedChildren; |
112 using InlineBox::setHasSelectedChildren; | 112 using InlineBox::setHasSelectedChildren; |
113 | 113 |
114 virtual RenderObject::SelectionState selectionState() const override final; | 114 virtual LayoutObject::SelectionState selectionState() const override final; |
115 InlineBox* firstSelectedBox() const; | 115 InlineBox* firstSelectedBox() const; |
116 InlineBox* lastSelectedBox() const; | 116 InlineBox* lastSelectedBox() const; |
117 | 117 |
118 GapRects lineSelectionGap(const RenderBlock* rootBlock, const LayoutPoint& r
ootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selT
op, LayoutUnit selHeight, const PaintInfo*) const; | 118 GapRects lineSelectionGap(const RenderBlock* rootBlock, const LayoutPoint& r
ootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, LayoutUnit selT
op, LayoutUnit selHeight, const PaintInfo*) const; |
119 | 119 |
120 RenderBlockFlow& block() const; | 120 RenderBlockFlow& block() const; |
121 | 121 |
122 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); | 122 InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves
); |
123 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); | 123 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeav
es = false); |
124 | 124 |
125 void appendFloat(RenderBox* floatingBox) | 125 void appendFloat(RenderBox* floatingBox) |
126 { | 126 { |
127 ASSERT(!isDirty()); | 127 ASSERT(!isDirty()); |
128 if (m_floats) | 128 if (m_floats) |
129 m_floats->append(floatingBox); | 129 m_floats->append(floatingBox); |
130 else | 130 else |
131 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); | 131 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); |
132 } | 132 } |
133 | 133 |
134 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} | 134 Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get();
} |
135 | 135 |
136 virtual void extractLineBoxFromRenderObject() override final; | 136 virtual void extractLineBoxFromLayoutObject() override final; |
137 virtual void attachLineBoxToRenderObject() override final; | 137 virtual void attachLineBoxToLayoutObject() override final; |
138 virtual void removeLineBoxFromRenderObject() override final; | 138 virtual void removeLineBoxFromLayoutObject() override final; |
139 | 139 |
140 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } | 140 FontBaseline baselineType() const { return static_cast<FontBaseline>(m_basel
ineType); } |
141 | 141 |
142 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } | 142 bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; } |
143 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } | 143 bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; } |
144 | 144 |
145 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; | 145 LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const; |
146 | 146 |
147 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, i
nt& ascent, int& descent, bool& affectsAscent, bool& affectsDescent) const; | 147 void ascentAndDescentForBox(InlineBox*, GlyphOverflowAndFallbackFontsMap&, i
nt& ascent, int& descent, bool& affectsAscent, bool& affectsDescent) const; |
148 LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&); | 148 LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 virtual const char* boxName() const override; | 180 virtual const char* boxName() const override; |
181 #endif | 181 #endif |
182 private: | 182 private: |
183 LayoutUnit beforeAnnotationsAdjustment() const; | 183 LayoutUnit beforeAnnotationsAdjustment() const; |
184 | 184 |
185 // This folds into the padding at the end of InlineFlowBox on 64-bit. | 185 // This folds into the padding at the end of InlineFlowBox on 64-bit. |
186 unsigned m_lineBreakPos; | 186 unsigned m_lineBreakPos; |
187 | 187 |
188 // Where this line ended. The exact object and the position within that obj
ect are stored so that | 188 // Where this line ended. The exact object and the position within that obj
ect are stored so that |
189 // we can create an InlineIterator beginning just after the end of this line
. | 189 // we can create an InlineIterator beginning just after the end of this line
. |
190 RenderObject* m_lineBreakObj; | 190 LayoutObject* m_lineBreakObj; |
191 RefPtr<BidiContext> m_lineBreakContext; | 191 RefPtr<BidiContext> m_lineBreakContext; |
192 | 192 |
193 // Floats hanging off the line are pushed into this vector during layout. It
is only | 193 // Floats hanging off the line are pushed into this vector during layout. It
is only |
194 // good for as long as the line has not been marked dirty. | 194 // good for as long as the line has not been marked dirty. |
195 OwnPtr<Vector<RenderBox*>> m_floats; | 195 OwnPtr<Vector<RenderBox*>> m_floats; |
196 | 196 |
197 LayoutUnit m_lineTop; | 197 LayoutUnit m_lineTop; |
198 LayoutUnit m_lineBottom; | 198 LayoutUnit m_lineBottom; |
199 LayoutUnit m_lineTopWithLeading; | 199 LayoutUnit m_lineTopWithLeading; |
200 LayoutUnit m_lineBottomWithLeading; | 200 LayoutUnit m_lineBottomWithLeading; |
201 LayoutUnit m_selectionBottom; | 201 LayoutUnit m_selectionBottom; |
202 LayoutUnit m_paginationStrut; | 202 LayoutUnit m_paginationStrut; |
203 }; | 203 }; |
204 | 204 |
205 } // namespace blink | 205 } // namespace blink |
206 | 206 |
207 #endif // RootInlineBox_h | 207 #endif // RootInlineBox_h |
OLD | NEW |