OLD | NEW |
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 Loading... |
37 // some RenderObject (i.e., it represents a portion of that RenderObject). | 37 // some RenderObject (i.e., it represents a portion of that RenderObject). |
38 class InlineBox { | 38 class InlineBox { |
39 WTF_MAKE_NONCOPYABLE(InlineBox); | 39 WTF_MAKE_NONCOPYABLE(InlineBox); |
40 public: | 40 public: |
41 InlineBox(RenderObject& obj) | 41 InlineBox(RenderObject& obj) |
42 : m_next(0) | 42 : m_next(0) |
43 , m_prev(0) | 43 , m_prev(0) |
44 , m_parent(0) | 44 , m_parent(0) |
45 , m_renderer(obj) | 45 , m_renderer(obj) |
46 , m_logicalWidth(0) | 46 , m_logicalWidth(0) |
47 #ifndef NDEBUG | 47 #if ENABLE(ASSERT) |
48 , m_hasBadParent(false) | 48 , m_hasBadParent(false) |
49 #endif | 49 #endif |
50 { | 50 { |
51 } | 51 } |
52 | 52 |
53 InlineBox(RenderObject& obj, FloatPoint topLeft, float logicalWidth, bool fi
rstLine, bool constructed, | 53 InlineBox(RenderObject& obj, FloatPoint topLeft, float logicalWidth, bool fi
rstLine, bool constructed, |
54 bool dirty, bool extracted, bool isHorizontal, InlineBox* next, In
lineBox* prev, InlineFlowBox* parent) | 54 bool dirty, bool extracted, bool isHorizontal, InlineBox* next, In
lineBox* prev, InlineFlowBox* parent) |
55 : m_next(next) | 55 : m_next(next) |
56 , m_prev(prev) | 56 , m_prev(prev) |
57 , m_parent(parent) | 57 , m_parent(parent) |
58 , m_renderer(obj) | 58 , m_renderer(obj) |
59 , m_topLeft(topLeft) | 59 , m_topLeft(topLeft) |
60 , m_logicalWidth(logicalWidth) | 60 , m_logicalWidth(logicalWidth) |
61 , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal) | 61 , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal) |
62 #ifndef NDEBUG | 62 #if ENABLE(ASSERT) |
63 , m_hasBadParent(false) | 63 , m_hasBadParent(false) |
64 #endif | 64 #endif |
65 { | 65 { |
66 } | 66 } |
67 | 67 |
68 virtual ~InlineBox(); | 68 virtual ~InlineBox(); |
69 | 69 |
70 virtual void destroy() { delete this; } | 70 virtual void destroy() { delete this; } |
71 | 71 |
72 virtual void deleteLine(); | 72 virtual void deleteLine(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 virtual void markDirty() { m_bitfields.setDirty(true); } | 261 virtual void markDirty() { m_bitfields.setDirty(true); } |
262 | 262 |
263 virtual void dirtyLineBoxes(); | 263 virtual void dirtyLineBoxes(); |
264 | 264 |
265 virtual RenderObject::SelectionState selectionState(); | 265 virtual RenderObject::SelectionState selectionState(); |
266 | 266 |
267 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid
th) const; | 267 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid
th) const; |
268 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. | 268 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. |
269 virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibl
eRightEdge, float ellipsisWidth, float &truncatedWidth, bool&); | 269 virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibl
eRightEdge, float ellipsisWidth, float &truncatedWidth, bool&); |
270 | 270 |
271 #ifndef NDEBUG | 271 #if ENABLE(ASSERT) |
272 void setHasBadParent(); | 272 void setHasBadParent(); |
273 #endif | 273 #endif |
274 | 274 |
275 int expansion() const { return m_bitfields.expansion(); } | 275 int expansion() const { return m_bitfields.expansion(); } |
276 | 276 |
277 bool visibleToHitTestRequest(const HitTestRequest& request) const { return r
enderer().visibleToHitTestRequest(request); } | 277 bool visibleToHitTestRequest(const HitTestRequest& request) const { return r
enderer().visibleToHitTestRequest(request); } |
278 | 278 |
279 EVerticalAlign verticalAlign() const { return renderer().style(m_bitfields.f
irstLine())->verticalAlign(); } | 279 EVerticalAlign verticalAlign() const { return renderer().style(m_bitfields.f
irstLine())->verticalAlign(); } |
280 | 280 |
281 // Use with caution! The type is not checked! | 281 // Use with caution! The type is not checked! |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 402 |
403 // For InlineFlowBox and InlineTextBox | 403 // For InlineFlowBox and InlineTextBox |
404 bool extracted() const { return m_bitfields.extracted(); } | 404 bool extracted() const { return m_bitfields.extracted(); } |
405 | 405 |
406 FloatPoint m_topLeft; | 406 FloatPoint m_topLeft; |
407 float m_logicalWidth; | 407 float m_logicalWidth; |
408 | 408 |
409 private: | 409 private: |
410 InlineBoxBitfields m_bitfields; | 410 InlineBoxBitfields m_bitfields; |
411 | 411 |
412 #ifndef NDEBUG | 412 #if ENABLE(ASSERT) |
413 bool m_hasBadParent; | 413 bool m_hasBadParent; |
414 #endif | 414 #endif |
415 }; | 415 }; |
416 | 416 |
417 #ifdef NDEBUG | 417 #if !ENABLE(ASSERT) |
418 inline InlineBox::~InlineBox() | 418 inline InlineBox::~InlineBox() |
419 { | 419 { |
420 } | 420 } |
421 #endif | 421 #endif |
422 | 422 |
423 #ifndef NDEBUG | 423 #if ENABLE(ASSERT) |
424 inline void InlineBox::setHasBadParent() | 424 inline void InlineBox::setHasBadParent() |
425 { | 425 { |
426 m_hasBadParent = true; | 426 m_hasBadParent = true; |
427 } | 427 } |
428 #endif | 428 #endif |
429 | 429 |
430 #define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ | 430 #define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ |
431 DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), box.is##typ
eName()) | 431 DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), box.is##typ
eName()) |
432 | 432 |
433 // Allow equality comparisons of InlineBox's by reference or pointer, interchang
eably. | 433 // Allow equality comparisons of InlineBox's by reference or pointer, interchang
eably. |
434 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) | 434 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) |
435 | 435 |
436 } // namespace WebCore | 436 } // namespace WebCore |
437 | 437 |
438 #ifndef NDEBUG | 438 #ifndef NDEBUG |
439 // Outside the WebCore namespace for ease of invocation from gdb. | 439 // Outside the WebCore namespace for ease of invocation from gdb. |
440 void showTree(const WebCore::InlineBox*); | 440 void showTree(const WebCore::InlineBox*); |
441 void showLineTree(const WebCore::InlineBox*); | 441 void showLineTree(const WebCore::InlineBox*); |
442 #endif | 442 #endif |
443 | 443 |
444 #endif // InlineBox_h | 444 #endif // InlineBox_h |
OLD | NEW |