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/rendering/FloatToLayoutUnit.h" |
24 #include "core/rendering/InlineFlowBox.h" | 25 #include "core/rendering/InlineFlowBox.h" |
25 #include "platform/text/BidiContext.h" | 26 #include "platform/text/BidiContext.h" |
26 | 27 |
27 namespace blink { | 28 namespace blink { |
28 | 29 |
29 class EllipsisBox; | 30 class EllipsisBox; |
30 class HitTestResult; | 31 class HitTestResult; |
31 class RenderBlockFlow; | 32 class RenderBlockFlow; |
32 | 33 |
33 struct BidiStatus; | 34 struct BidiStatus; |
34 struct GapRects; | 35 struct GapRects; |
35 | 36 |
36 class RootInlineBox : public InlineFlowBox { | 37 class RootInlineBox : public InlineFlowBox { |
37 public: | 38 public: |
38 explicit RootInlineBox(RenderBlockFlow&); | 39 explicit RootInlineBox(RenderBlockFlow&); |
39 | 40 |
40 virtual void destroy() override final; | 41 virtual void destroy() override final; |
41 | 42 |
42 virtual bool isRootInlineBox() const override final { return true; } | 43 virtual bool isRootInlineBox() const override final { return true; } |
43 | 44 |
44 void detachEllipsisBox(); | 45 void detachEllipsisBox(); |
45 | 46 |
46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } | 47 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne
xtLineBox); } |
47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } | 48 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } |
48 | 49 |
49 virtual void adjustPosition(float dx, float dy) override final; | 50 virtual void adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUnit
dy) override final; |
50 | 51 |
51 LayoutUnit lineTop() const { return m_lineTop; } | 52 LayoutUnit lineTop() const { return m_lineTop; } |
52 LayoutUnit lineBottom() const { return m_lineBottom; } | 53 LayoutUnit lineBottom() const { return m_lineBottom; } |
53 | 54 |
54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } | 55 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } |
55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } | 56 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } |
56 | 57 |
57 LayoutUnit paginationStrut() const { return m_fragmentationData ? m_fragment
ationData->m_paginationStrut : LayoutUnit(0); } | 58 LayoutUnit paginationStrut() const { return m_fragmentationData ? m_fragment
ationData->m_paginationStrut : LayoutUnit(0); } |
58 void setPaginationStrut(LayoutUnit strut) { ensureLineFragmentationData()->m
_paginationStrut = strut; } | 59 void setPaginationStrut(LayoutUnit strut) { ensureLineFragmentationData()->m
_paginationStrut = strut; } |
59 | 60 |
(...skipping 30 matching lines...) Expand all Loading... |
90 unsigned lineBreakPos() const { return m_lineBreakPos; } | 91 unsigned lineBreakPos() const { return m_lineBreakPos; } |
91 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } | 92 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } |
92 | 93 |
93 using InlineBox::endsWithBreak; | 94 using InlineBox::endsWithBreak; |
94 using InlineBox::setEndsWithBreak; | 95 using InlineBox::setEndsWithBreak; |
95 | 96 |
96 void childRemoved(InlineBox* box); | 97 void childRemoved(InlineBox* box); |
97 | 98 |
98 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); | 99 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in
t ellipsisWidth); |
99 // Return the truncatedWidth, the width of the truncated text + ellipsis. | 100 // Return the truncatedWidth, the width of the truncated text + ellipsis. |
100 float placeEllipsis(const AtomicString& ellipsisStr, bool ltr, float blockLe
ftEdge, float blockRightEdge, float ellipsisWidth, InlineBox* markupBox = 0); | 101 FloatWillBeLayoutUnit placeEllipsis(const AtomicString& ellipsisStr, bool lt
r, FloatWillBeLayoutUnit blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, Fl
oatWillBeLayoutUnit ellipsisWidth, InlineBox* markupBox = 0); |
101 // Return the position of the EllipsisBox or -1. | 102 // Return the position of the EllipsisBox or -1. |
102 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig
htEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) override fin
al; | 103 virtual FloatWillBeLayoutUnit placeEllipsisBox(bool ltr, FloatWillBeLayoutUn
it blockLeftEdge, FloatWillBeLayoutUnit blockRightEdge, FloatWillBeLayoutUnit el
lipsisWidth, FloatWillBeLayoutUnit &truncatedWidth, bool& foundBox) override fin
al; |
103 | 104 |
104 using InlineBox::hasEllipsisBox; | 105 using InlineBox::hasEllipsisBox; |
105 EllipsisBox* ellipsisBox() const; | 106 EllipsisBox* ellipsisBox() const; |
106 | 107 |
107 virtual void clearTruncation() override final; | 108 virtual void clearTruncation() override final; |
108 | 109 |
109 virtual int baselinePosition(FontBaseline baselineType) const override final
; | 110 virtual int baselinePosition(FontBaseline baselineType) const override final
; |
110 virtual LayoutUnit lineHeight() const override final; | 111 virtual LayoutUnit lineHeight() const override final; |
111 | 112 |
112 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) override; | 113 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) override; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 LayoutUnit logicalTopLayoutOverflow() const | 169 LayoutUnit logicalTopLayoutOverflow() const |
169 { | 170 { |
170 return InlineFlowBox::logicalTopLayoutOverflow(lineTop()); | 171 return InlineFlowBox::logicalTopLayoutOverflow(lineTop()); |
171 } | 172 } |
172 LayoutUnit logicalBottomLayoutOverflow() const | 173 LayoutUnit logicalBottomLayoutOverflow() const |
173 { | 174 { |
174 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom()); | 175 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom()); |
175 } | 176 } |
176 | 177 |
177 // Used to calculate the underline offset for TextUnderlinePositionUnder. | 178 // Used to calculate the underline offset for TextUnderlinePositionUnder. |
178 float maxLogicalTop() const; | 179 FloatWillBeLayoutUnit maxLogicalTop() const; |
179 | 180 |
180 Node* getLogicalStartBoxWithNode(InlineBox*&) const; | 181 Node* getLogicalStartBoxWithNode(InlineBox*&) const; |
181 Node* getLogicalEndBoxWithNode(InlineBox*&) const; | 182 Node* getLogicalEndBoxWithNode(InlineBox*&) const; |
182 | 183 |
183 #ifndef NDEBUG | 184 #ifndef NDEBUG |
184 virtual const char* boxName() const override; | 185 virtual const char* boxName() const override; |
185 #endif | 186 #endif |
186 private: | 187 private: |
187 LayoutUnit beforeAnnotationsAdjustment() const; | 188 LayoutUnit beforeAnnotationsAdjustment() const; |
188 | 189 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 LayoutUnit m_lineTop; | 229 LayoutUnit m_lineTop; |
229 LayoutUnit m_lineBottom; | 230 LayoutUnit m_lineBottom; |
230 LayoutUnit m_lineTopWithLeading; | 231 LayoutUnit m_lineTopWithLeading; |
231 LayoutUnit m_lineBottomWithLeading; | 232 LayoutUnit m_lineBottomWithLeading; |
232 LayoutUnit m_selectionBottom; | 233 LayoutUnit m_selectionBottom; |
233 }; | 234 }; |
234 | 235 |
235 } // namespace blink | 236 } // namespace blink |
236 | 237 |
237 #endif // RootInlineBox_h | 238 #endif // RootInlineBox_h |
OLD | NEW |