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

Side by Side Diff: Source/core/rendering/InlineBox.h

Issue 699683002: Continue with InlineBox float->LayoutUnit migration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit Created 6 years, 1 month 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/rendering/FloatToLayoutUnit.h ('k') | Source/core/rendering/InlineBox.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, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights 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 26 matching lines...) Expand all
37 // InlineBox represents a rectangle that occurs on a line. It corresponds to 37 // InlineBox represents a rectangle that occurs on a line. It corresponds to
38 // some RenderObject (i.e., it represents a portion of that RenderObject). 38 // some RenderObject (i.e., it represents a portion of that RenderObject).
39 class InlineBox { 39 class InlineBox {
40 WTF_MAKE_NONCOPYABLE(InlineBox); 40 WTF_MAKE_NONCOPYABLE(InlineBox);
41 public: 41 public:
42 InlineBox(RenderObject& obj) 42 InlineBox(RenderObject& obj)
43 : m_next(0) 43 : m_next(0)
44 , m_prev(0) 44 , m_prev(0)
45 , m_parent(0) 45 , m_parent(0)
46 , m_renderer(obj) 46 , m_renderer(obj)
47 , m_logicalWidth(ZERO_LAYOUT_UNIT) 47 , m_logicalWidth(0)
48 #if ENABLE(ASSERT) 48 #if ENABLE(ASSERT)
49 , m_hasBadParent(false) 49 , m_hasBadParent(false)
50 #endif 50 #endif
51 { 51 {
52 } 52 }
53 53
54 InlineBox(RenderObject& obj, FloatPointWillBeLayoutPoint topLeft, FloatWillB eLayoutUnit logicalWidth, bool firstLine, bool constructed, 54 InlineBox(RenderObject& obj, FloatPointWillBeLayoutPoint topLeft, FloatWillB eLayoutUnit logicalWidth, bool firstLine, bool constructed,
55 bool dirty, bool extracted, bool isHorizontal, InlineBox* next, In lineBox* prev, InlineFlowBox* parent) 55 bool dirty, bool extracted, bool isHorizontal, InlineBox* next, In lineBox* prev, InlineFlowBox* parent)
56 : m_next(next) 56 : m_next(next)
57 , m_prev(prev) 57 , m_prev(prev)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 virtual bool isSVGInlineTextBox() const { return false; } 125 virtual bool isSVGInlineTextBox() const { return false; }
126 virtual bool isSVGInlineFlowBox() const { return false; } 126 virtual bool isSVGInlineFlowBox() const { return false; }
127 virtual bool isSVGRootInlineBox() const { return false; } 127 virtual bool isSVGRootInlineBox() const { return false; }
128 128
129 bool hasVirtualLogicalHeight() const { return m_bitfields.hasVirtualLogicalH eight(); } 129 bool hasVirtualLogicalHeight() const { return m_bitfields.hasVirtualLogicalH eight(); }
130 void setHasVirtualLogicalHeight() { m_bitfields.setHasVirtualLogicalHeight(t rue); } 130 void setHasVirtualLogicalHeight() { m_bitfields.setHasVirtualLogicalHeight(t rue); }
131 virtual FloatWillBeLayoutUnit virtualLogicalHeight() const 131 virtual FloatWillBeLayoutUnit virtualLogicalHeight() const
132 { 132 {
133 ASSERT_NOT_REACHED(); 133 ASSERT_NOT_REACHED();
134 return ZERO_LAYOUT_UNIT; 134 return 0;
135 } 135 }
136 136
137 bool isHorizontal() const { return m_bitfields.isHorizontal(); } 137 bool isHorizontal() const { return m_bitfields.isHorizontal(); }
138 void setIsHorizontal(bool isHorizontal) { m_bitfields.setIsHorizontal(isHori zontal); } 138 void setIsHorizontal(bool isHorizontal) { m_bitfields.setIsHorizontal(isHori zontal); }
139 139
140 virtual FloatRectWillBeLayoutRect calculateBoundaries() const 140 virtual FloatRectWillBeLayoutRect calculateBoundaries() const
141 { 141 {
142 ASSERT_NOT_REACHED(); 142 ASSERT_NOT_REACHED();
143 return FloatRectWillBeLayoutRect(); 143 return FloatRectWillBeLayoutRect();
144 } 144 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 FloatWillBeLayoutUnit logicalLeft() const { return isHorizontal() ? m_topLef t.x() : m_topLeft.y(); } 212 FloatWillBeLayoutUnit logicalLeft() const { return isHorizontal() ? m_topLef t.x() : m_topLeft.y(); }
213 FloatWillBeLayoutUnit logicalRight() const { return logicalLeft() + logicalW idth(); } 213 FloatWillBeLayoutUnit logicalRight() const { return logicalLeft() + logicalW idth(); }
214 void setLogicalLeft(FloatWillBeLayoutUnit left) 214 void setLogicalLeft(FloatWillBeLayoutUnit left)
215 { 215 {
216 if (isHorizontal()) 216 if (isHorizontal())
217 setX(left); 217 setX(left);
218 else 218 else
219 setY(left); 219 setY(left);
220 } 220 }
221 int pixelSnappedLogicalLeft() const { return logicalLeft(); } 221 int pixelSnappedLogicalLeft() const { return logicalLeft(); }
222 int pixelSnappedLogicalRight() const { return LAYOUT_UNIT_CEIL(logicalRight( )); } 222 int pixelSnappedLogicalRight() const { return ceilf(logicalRight()); }
223 int pixelSnappedLogicalTop() const { return logicalTop(); } 223 int pixelSnappedLogicalTop() const { return logicalTop(); }
224 int pixelSnappedLogicalBottom() const { return LAYOUT_UNIT_CEIL(logicalBotto m()); } 224 int pixelSnappedLogicalBottom() const { return ceilf(logicalBottom()); }
225 225
226 // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line. 226 // The logicalTop[ position is the top edge of the line box in a horizontal line and the left edge in a vertical line.
227 FloatWillBeLayoutUnit logicalTop() const { return isHorizontal() ? m_topLeft .y() : m_topLeft.x(); } 227 FloatWillBeLayoutUnit logicalTop() const { return isHorizontal() ? m_topLeft .y() : m_topLeft.x(); }
228 FloatWillBeLayoutUnit logicalBottom() const { return logicalTop() + logicalH eight(); } 228 FloatWillBeLayoutUnit logicalBottom() const { return logicalTop() + logicalH eight(); }
229 void setLogicalTop(FloatWillBeLayoutUnit top) 229 void setLogicalTop(FloatWillBeLayoutUnit top)
230 { 230 {
231 if (isHorizontal()) 231 if (isHorizontal())
232 setY(top); 232 setY(top);
233 else 233 else
234 setX(top); 234 setX(top);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 436
437 } // namespace blink 437 } // namespace blink
438 438
439 #ifndef NDEBUG 439 #ifndef NDEBUG
440 // Outside the WebCore namespace for ease of invocation from gdb. 440 // Outside the WebCore namespace for ease of invocation from gdb.
441 void showTree(const blink::InlineBox*); 441 void showTree(const blink::InlineBox*);
442 void showLineTree(const blink::InlineBox*); 442 void showLineTree(const blink::InlineBox*);
443 #endif 443 #endif
444 444
445 #endif // InlineBox_h 445 #endif // InlineBox_h
OLDNEW
« no previous file with comments | « Source/core/rendering/FloatToLayoutUnit.h ('k') | Source/core/rendering/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698