Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Side by Side Diff: Source/core/layout/line/RootInlineBox.h

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/line/InlineTextBox.cpp ('k') | Source/core/layout/line/RootInlineBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/line/FloatToLayoutUnit.h"
25 #include "core/layout/line/InlineFlowBox.h" 24 #include "core/layout/line/InlineFlowBox.h"
26 #include "platform/text/BidiContext.h" 25 #include "platform/text/BidiContext.h"
27 26
28 namespace blink { 27 namespace blink {
29 28
30 class EllipsisBox; 29 class EllipsisBox;
31 class HitTestResult; 30 class HitTestResult;
32 class LayoutBlockFlow; 31 class LayoutBlockFlow;
33 32
34 struct BidiStatus; 33 struct BidiStatus;
35 struct GapRects; 34 struct GapRects;
36 35
37 class RootInlineBox : public InlineFlowBox { 36 class RootInlineBox : public InlineFlowBox {
38 public: 37 public:
39 explicit RootInlineBox(LayoutBlockFlow&); 38 explicit RootInlineBox(LayoutBlockFlow&);
40 39
41 virtual void destroy() override final; 40 virtual void destroy() override final;
42 41
43 virtual bool isRootInlineBox() const override final { return true; } 42 virtual bool isRootInlineBox() const override final { return true; }
44 43
45 void detachEllipsisBox(); 44 void detachEllipsisBox();
46 45
47 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne xtLineBox); } 46 RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_ne xtLineBox); }
48 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr evLineBox); } 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr evLineBox); }
49 48
50 virtual void adjustPosition(FloatWillBeLayoutUnit dx, FloatWillBeLayoutUnit dy) override final; 49 virtual void adjustPosition(LayoutUnit dx, LayoutUnit dy) override final;
51 50
52 LayoutUnit lineTop() const { return m_lineTop; } 51 LayoutUnit lineTop() const { return m_lineTop; }
53 LayoutUnit lineBottom() const { return m_lineBottom; } 52 LayoutUnit lineBottom() const { return m_lineBottom; }
54 53
55 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } 54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; }
56 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } 55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; }
57 56
58 LayoutUnit paginationStrut() const { return m_paginationStrut; } 57 LayoutUnit paginationStrut() const { return m_paginationStrut; }
59 void setPaginationStrut(LayoutUnit strut) { m_paginationStrut = strut; } 58 void setPaginationStrut(LayoutUnit strut) { m_paginationStrut = strut; }
60 59
(...skipping 25 matching lines...) Expand all
86 unsigned lineBreakPos() const { return m_lineBreakPos; } 85 unsigned lineBreakPos() const { return m_lineBreakPos; }
87 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; } 86 void setLineBreakPos(unsigned p) { m_lineBreakPos = p; }
88 87
89 using InlineBox::endsWithBreak; 88 using InlineBox::endsWithBreak;
90 using InlineBox::setEndsWithBreak; 89 using InlineBox::setEndsWithBreak;
91 90
92 void childRemoved(InlineBox*); 91 void childRemoved(InlineBox*);
93 92
94 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in t ellipsisWidth); 93 bool lineCanAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, in t ellipsisWidth);
95 // Return the truncatedWidth, the width of the truncated text + ellipsis. 94 // 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); 95 LayoutUnit placeEllipsis(const AtomicString& ellipsisStr, bool ltr, LayoutUn it blockLeftEdge, LayoutUnit blockRightEdge, LayoutUnit ellipsisWidth);
97 // Return the position of the EllipsisBox or -1. 96 // 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; 97 virtual LayoutUnit placeEllipsisBox(bool ltr, LayoutUnit blockLeftEdge, Layo utUnit blockRightEdge, LayoutUnit ellipsisWidth, LayoutUnit &truncatedWidth, boo l& foundBox) override final;
99 98
100 using InlineBox::hasEllipsisBox; 99 using InlineBox::hasEllipsisBox;
101 EllipsisBox* ellipsisBox() const; 100 EllipsisBox* ellipsisBox() const;
102 101
103 virtual void clearTruncation() override final; 102 virtual void clearTruncation() override final;
104 103
105 virtual int baselinePosition(FontBaseline baselineType) const override final ; 104 virtual int baselinePosition(FontBaseline baselineType) const override final ;
106 virtual LayoutUnit lineHeight() const override final; 105 virtual LayoutUnit lineHeight() const override final;
107 106
108 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override; 107 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 LayoutUnit logicalTopLayoutOverflow() const 163 LayoutUnit logicalTopLayoutOverflow() const
165 { 164 {
166 return InlineFlowBox::logicalTopLayoutOverflow(lineTop()); 165 return InlineFlowBox::logicalTopLayoutOverflow(lineTop());
167 } 166 }
168 LayoutUnit logicalBottomLayoutOverflow() const 167 LayoutUnit logicalBottomLayoutOverflow() const
169 { 168 {
170 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom()); 169 return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom());
171 } 170 }
172 171
173 // Used to calculate the underline offset for TextUnderlinePositionUnder. 172 // Used to calculate the underline offset for TextUnderlinePositionUnder.
174 FloatWillBeLayoutUnit maxLogicalTop() const; 173 LayoutUnit maxLogicalTop() const;
175 174
176 Node* getLogicalStartBoxWithNode(InlineBox*&) const; 175 Node* getLogicalStartBoxWithNode(InlineBox*&) const;
177 Node* getLogicalEndBoxWithNode(InlineBox*&) const; 176 Node* getLogicalEndBoxWithNode(InlineBox*&) const;
178 177
179 virtual const char* boxName() const override; 178 virtual const char* boxName() const override;
180 179
181 private: 180 private:
182 LayoutUnit beforeAnnotationsAdjustment() const; 181 LayoutUnit beforeAnnotationsAdjustment() const;
183 182
184 // This folds into the padding at the end of InlineFlowBox on 64-bit. 183 // This folds into the padding at the end of InlineFlowBox on 64-bit.
(...skipping 12 matching lines...) Expand all
197 LayoutUnit m_lineBottom; 196 LayoutUnit m_lineBottom;
198 LayoutUnit m_lineTopWithLeading; 197 LayoutUnit m_lineTopWithLeading;
199 LayoutUnit m_lineBottomWithLeading; 198 LayoutUnit m_lineBottomWithLeading;
200 LayoutUnit m_selectionBottom; 199 LayoutUnit m_selectionBottom;
201 LayoutUnit m_paginationStrut; 200 LayoutUnit m_paginationStrut;
202 }; 201 };
203 202
204 } // namespace blink 203 } // namespace blink
205 204
206 #endif // RootInlineBox_h 205 #endif // RootInlineBox_h
OLDNEW
« no previous file with comments | « Source/core/layout/line/InlineTextBox.cpp ('k') | Source/core/layout/line/RootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698