OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 struct SameSizeAsInlineFlowBox : public InlineBox { | 44 struct SameSizeAsInlineFlowBox : public InlineBox { |
45 void* pointers[5]; | 45 void* pointers[5]; |
46 uint32_t bitfields : 23; | 46 uint32_t bitfields : 23; |
47 }; | 47 }; |
48 | 48 |
49 COMPILE_ASSERT(sizeof(InlineFlowBox) == sizeof(SameSizeAsInlineFlowBox), InlineF
lowBox_should_stay_small); | 49 COMPILE_ASSERT(sizeof(InlineFlowBox) == sizeof(SameSizeAsInlineFlowBox), InlineF
lowBox_should_stay_small); |
50 | 50 |
51 #ifndef NDEBUG | 51 #if ENABLE(ASSERT) |
52 | 52 |
53 InlineFlowBox::~InlineFlowBox() | 53 InlineFlowBox::~InlineFlowBox() |
54 { | 54 { |
55 if (!m_hasBadChildList) | 55 if (!m_hasBadChildList) |
56 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()
) | 56 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()
) |
57 child->setHasBadParent(); | 57 child->setHasBadParent(); |
58 } | 58 } |
59 | 59 |
60 #endif | 60 #endif |
61 | 61 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 checkConsistency(); | 199 checkConsistency(); |
200 } | 200 } |
201 | 201 |
202 void InlineFlowBox::deleteLine() | 202 void InlineFlowBox::deleteLine() |
203 { | 203 { |
204 InlineBox* child = firstChild(); | 204 InlineBox* child = firstChild(); |
205 InlineBox* next = 0; | 205 InlineBox* next = 0; |
206 while (child) { | 206 while (child) { |
207 ASSERT(this == child->parent()); | 207 ASSERT(this == child->parent()); |
208 next = child->nextOnLine(); | 208 next = child->nextOnLine(); |
209 #ifndef NDEBUG | 209 #if ENABLE(ASSERT) |
210 child->setParent(0); | 210 child->setParent(0); |
211 #endif | 211 #endif |
212 child->deleteLine(); | 212 child->deleteLine(); |
213 child = next; | 213 child = next; |
214 } | 214 } |
215 #ifndef NDEBUG | 215 #if ENABLE(ASSERT) |
216 m_firstChild = 0; | 216 m_firstChild = 0; |
217 m_lastChild = 0; | 217 m_lastChild = 0; |
218 #endif | 218 #endif |
219 | 219 |
220 removeLineBoxFromRenderObject(); | 220 removeLineBoxFromRenderObject(); |
221 destroy(); | 221 destroy(); |
222 } | 222 } |
223 | 223 |
224 void InlineFlowBox::removeLineBoxFromRenderObject() | 224 void InlineFlowBox::removeLineBoxFromRenderObject() |
225 { | 225 { |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 return "InlineFlowBox"; | 1644 return "InlineFlowBox"; |
1645 } | 1645 } |
1646 | 1646 |
1647 void InlineFlowBox::showLineTreeAndMark(const InlineBox* markedBox1, const char*
markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Rend
erObject* obj, int depth) const | 1647 void InlineFlowBox::showLineTreeAndMark(const InlineBox* markedBox1, const char*
markedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Rend
erObject* obj, int depth) const |
1648 { | 1648 { |
1649 InlineBox::showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedL
abel2, obj, depth); | 1649 InlineBox::showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedL
abel2, obj, depth); |
1650 for (const InlineBox* box = firstChild(); box; box = box->nextOnLine()) | 1650 for (const InlineBox* box = firstChild(); box; box = box->nextOnLine()) |
1651 box->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLab
el2, obj, depth + 1); | 1651 box->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLab
el2, obj, depth + 1); |
1652 } | 1652 } |
1653 | 1653 |
| 1654 #endif |
| 1655 |
| 1656 #if ENABLE(ASSERT) |
1654 void InlineFlowBox::checkConsistency() const | 1657 void InlineFlowBox::checkConsistency() const |
1655 { | 1658 { |
1656 #ifdef CHECK_CONSISTENCY | 1659 #ifdef CHECK_CONSISTENCY |
1657 ASSERT(!m_hasBadChildList); | 1660 ASSERT(!m_hasBadChildList); |
1658 const InlineBox* prev = 0; | 1661 const InlineBox* prev = 0; |
1659 for (const InlineBox* child = m_firstChild; child; child = child->nextOnLine
()) { | 1662 for (const InlineBox* child = m_firstChild; child; child = child->nextOnLine
()) { |
1660 ASSERT(child->parent() == this); | 1663 ASSERT(child->parent() == this); |
1661 ASSERT(child->prevOnLine() == prev); | 1664 ASSERT(child->prevOnLine() == prev); |
1662 prev = child; | 1665 prev = child; |
1663 } | 1666 } |
1664 ASSERT(prev == m_lastChild); | 1667 ASSERT(prev == m_lastChild); |
1665 #endif | 1668 #endif |
1666 } | 1669 } |
1667 | 1670 |
1668 #endif | 1671 #endif |
1669 | 1672 |
1670 } // namespace WebCore | 1673 } // namespace WebCore |
OLD | NEW |