| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class CORE_EXPORT InlineBox : public DisplayItemClient { | 44 class CORE_EXPORT InlineBox : public DisplayItemClient { |
| 45 WTF_MAKE_NONCOPYABLE(InlineBox); | 45 WTF_MAKE_NONCOPYABLE(InlineBox); |
| 46 | 46 |
| 47 public: | 47 public: |
| 48 InlineBox(LineLayoutItem obj) | 48 InlineBox(LineLayoutItem obj) |
| 49 : m_next(nullptr), | 49 : m_next(nullptr), |
| 50 m_prev(nullptr), | 50 m_prev(nullptr), |
| 51 m_parent(nullptr), | 51 m_parent(nullptr), |
| 52 m_lineLayoutItem(obj), | 52 m_lineLayoutItem(obj), |
| 53 m_logicalWidth() | 53 m_logicalWidth() |
| 54 #if ENABLE(ASSERT) | |
| 55 , | |
| 56 m_hasBadParent(false) | |
| 57 #endif | |
| 58 { | 54 { |
| 59 } | 55 } |
| 60 | 56 |
| 61 InlineBox(LineLayoutItem item, | 57 InlineBox(LineLayoutItem item, |
| 62 LayoutPoint topLeft, | 58 LayoutPoint topLeft, |
| 63 LayoutUnit logicalWidth, | 59 LayoutUnit logicalWidth, |
| 64 bool firstLine, | 60 bool firstLine, |
| 65 bool constructed, | 61 bool constructed, |
| 66 bool dirty, | 62 bool dirty, |
| 67 bool extracted, | 63 bool extracted, |
| 68 bool isHorizontal, | 64 bool isHorizontal, |
| 69 InlineBox* next, | 65 InlineBox* next, |
| 70 InlineBox* prev, | 66 InlineBox* prev, |
| 71 InlineFlowBox* parent) | 67 InlineFlowBox* parent) |
| 72 : m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal), | 68 : m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal), |
| 73 m_next(next), | 69 m_next(next), |
| 74 m_prev(prev), | 70 m_prev(prev), |
| 75 m_parent(parent), | 71 m_parent(parent), |
| 76 m_lineLayoutItem(item), | 72 m_lineLayoutItem(item), |
| 77 m_location(topLeft), | 73 m_location(topLeft), |
| 78 m_logicalWidth(logicalWidth) | 74 m_logicalWidth(logicalWidth) |
| 79 #if ENABLE(ASSERT) | |
| 80 , | |
| 81 m_hasBadParent(false) | |
| 82 #endif | |
| 83 { | 75 { |
| 84 } | 76 } |
| 85 | 77 |
| 86 virtual ~InlineBox(); | 78 virtual ~InlineBox(); |
| 87 | 79 |
| 88 virtual void destroy(); | 80 virtual void destroy(); |
| 89 | 81 |
| 90 virtual void deleteLine(); | 82 virtual void deleteLine(); |
| 91 virtual void extractLine(); | 83 virtual void extractLine(); |
| 92 virtual void attachLine(); | 84 virtual void attachLine(); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 int blockEdge, | 318 int blockEdge, |
| 327 int ellipsisWidth) const; | 319 int ellipsisWidth) const; |
| 328 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. | 320 // visibleLeftEdge, visibleRightEdge are in the parent's coordinate system. |
| 329 virtual LayoutUnit placeEllipsisBox(bool ltr, | 321 virtual LayoutUnit placeEllipsisBox(bool ltr, |
| 330 LayoutUnit visibleLeftEdge, | 322 LayoutUnit visibleLeftEdge, |
| 331 LayoutUnit visibleRightEdge, | 323 LayoutUnit visibleRightEdge, |
| 332 LayoutUnit ellipsisWidth, | 324 LayoutUnit ellipsisWidth, |
| 333 LayoutUnit& truncatedWidth, | 325 LayoutUnit& truncatedWidth, |
| 334 bool&); | 326 bool&); |
| 335 | 327 |
| 336 #if ENABLE(ASSERT) | 328 #if DCHECK_IS_ON() |
| 337 void setHasBadParent(); | 329 void setHasBadParent(); |
| 338 #endif | 330 #endif |
| 339 | 331 |
| 340 int expansion() const { return m_bitfields.expansion(); } | 332 int expansion() const { return m_bitfields.expansion(); } |
| 341 | 333 |
| 342 bool visibleToHitTestRequest(const HitTestRequest& request) const { | 334 bool visibleToHitTestRequest(const HitTestRequest& request) const { |
| 343 return getLineLayoutItem().visibleToHitTestRequest(request); | 335 return getLineLayoutItem().visibleToHitTestRequest(request); |
| 344 } | 336 } |
| 345 | 337 |
| 346 // Anonymous inline: https://drafts.csswg.org/css2/visuren.html#anonymous | 338 // Anonymous inline: https://drafts.csswg.org/css2/visuren.html#anonymous |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 signed expansion() { return m_bitfields.expansion(); } | 534 signed expansion() { return m_bitfields.expansion(); } |
| 543 void setExpansion(signed expansion) { m_bitfields.setExpansion(expansion); } | 535 void setExpansion(signed expansion) { m_bitfields.setExpansion(expansion); } |
| 544 | 536 |
| 545 // For InlineFlowBox and InlineTextBox | 537 // For InlineFlowBox and InlineTextBox |
| 546 bool extracted() const { return m_bitfields.extracted(); } | 538 bool extracted() const { return m_bitfields.extracted(); } |
| 547 | 539 |
| 548 LayoutPoint m_location; | 540 LayoutPoint m_location; |
| 549 LayoutUnit m_logicalWidth; | 541 LayoutUnit m_logicalWidth; |
| 550 | 542 |
| 551 private: | 543 private: |
| 552 #if ENABLE(ASSERT) | 544 #if DCHECK_IS_ON() |
| 553 bool m_hasBadParent; | 545 bool m_hasBadParent = false; |
| 554 #endif | 546 #endif |
| 555 }; | 547 }; |
| 556 | 548 |
| 557 #if !ENABLE(ASSERT) | 549 #if !DCHECK_IS_ON() |
| 558 inline InlineBox::~InlineBox() {} | 550 inline InlineBox::~InlineBox() {} |
| 559 #endif | 551 #endif |
| 560 | 552 |
| 561 #if ENABLE(ASSERT) | 553 #if DCHECK_IS_ON() |
| 562 inline void InlineBox::setHasBadParent() { | 554 inline void InlineBox::setHasBadParent() { |
| 563 m_hasBadParent = true; | 555 m_hasBadParent = true; |
| 564 } | 556 } |
| 565 #endif | 557 #endif |
| 566 | 558 |
| 567 #define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ | 559 #define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ |
| 568 DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), \ | 560 DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), \ |
| 569 box.is##typeName()) | 561 box.is##typeName()) |
| 570 | 562 |
| 571 // Allow equality comparisons of InlineBox's by reference or pointer, | 563 // Allow equality comparisons of InlineBox's by reference or pointer, |
| 572 // interchangeably. | 564 // interchangeably. |
| 573 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) | 565 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) |
| 574 | 566 |
| 575 } // namespace blink | 567 } // namespace blink |
| 576 | 568 |
| 577 #ifndef NDEBUG | 569 #ifndef NDEBUG |
| 578 // Outside the WebCore namespace for ease of invocation from gdb. | 570 // Outside the WebCore namespace for ease of invocation from gdb. |
| 579 void showTree(const blink::InlineBox*); | 571 void showTree(const blink::InlineBox*); |
| 580 void showLineTree(const blink::InlineBox*); | 572 void showLineTree(const blink::InlineBox*); |
| 581 #endif | 573 #endif |
| 582 | 574 |
| 583 #endif // InlineBox_h | 575 #endif // InlineBox_h |
| OLD | NEW |