OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "core/rendering/RenderLineBoxList.h" | 30 #include "core/rendering/RenderLineBoxList.h" |
31 | 31 |
32 #include "core/rendering/HitTestResult.h" | 32 #include "core/rendering/HitTestResult.h" |
33 #include "core/rendering/InlineTextBox.h" | 33 #include "core/rendering/InlineTextBox.h" |
34 #include "core/rendering/PaintInfo.h" | 34 #include "core/rendering/PaintInfo.h" |
35 #include "core/rendering/RenderArena.h" | |
36 #include "core/rendering/RenderInline.h" | 35 #include "core/rendering/RenderInline.h" |
37 #include "core/rendering/RootInlineBox.h" | 36 #include "core/rendering/RootInlineBox.h" |
38 | 37 |
39 using namespace std; | 38 using namespace std; |
40 | 39 |
41 namespace WebCore { | 40 namespace WebCore { |
42 | 41 |
43 #ifndef NDEBUG | 42 #ifndef NDEBUG |
44 RenderLineBoxList::~RenderLineBoxList() | 43 RenderLineBoxList::~RenderLineBoxList() |
45 { | 44 { |
(...skipping 10 matching lines...) Expand all Loading... |
56 m_firstLineBox = m_lastLineBox = box; | 55 m_firstLineBox = m_lastLineBox = box; |
57 else { | 56 else { |
58 m_lastLineBox->setNextLineBox(box); | 57 m_lastLineBox->setNextLineBox(box); |
59 box->setPreviousLineBox(m_lastLineBox); | 58 box->setPreviousLineBox(m_lastLineBox); |
60 m_lastLineBox = box; | 59 m_lastLineBox = box; |
61 } | 60 } |
62 | 61 |
63 checkConsistency(); | 62 checkConsistency(); |
64 } | 63 } |
65 | 64 |
66 void RenderLineBoxList::deleteLineBoxTree(RenderArena* arena) | 65 void RenderLineBoxList::deleteLineBoxTree() |
67 { | 66 { |
68 InlineFlowBox* line = m_firstLineBox; | 67 InlineFlowBox* line = m_firstLineBox; |
69 InlineFlowBox* nextLine; | 68 InlineFlowBox* nextLine; |
70 while (line) { | 69 while (line) { |
71 nextLine = line->nextLineBox(); | 70 nextLine = line->nextLineBox(); |
72 line->deleteLine(arena); | 71 line->deleteLine(); |
73 line = nextLine; | 72 line = nextLine; |
74 } | 73 } |
75 m_firstLineBox = m_lastLineBox = 0; | 74 m_firstLineBox = m_lastLineBox = 0; |
76 } | 75 } |
77 | 76 |
78 void RenderLineBoxList::extractLineBox(InlineFlowBox* box) | 77 void RenderLineBoxList::extractLineBox(InlineFlowBox* box) |
79 { | 78 { |
80 checkConsistency(); | 79 checkConsistency(); |
81 | 80 |
82 m_lastLineBox = box->prevLineBox(); | 81 m_lastLineBox = box->prevLineBox(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (box == m_lastLineBox) | 118 if (box == m_lastLineBox) |
120 m_lastLineBox = box->prevLineBox(); | 119 m_lastLineBox = box->prevLineBox(); |
121 if (box->nextLineBox()) | 120 if (box->nextLineBox()) |
122 box->nextLineBox()->setPreviousLineBox(box->prevLineBox()); | 121 box->nextLineBox()->setPreviousLineBox(box->prevLineBox()); |
123 if (box->prevLineBox()) | 122 if (box->prevLineBox()) |
124 box->prevLineBox()->setNextLineBox(box->nextLineBox()); | 123 box->prevLineBox()->setNextLineBox(box->nextLineBox()); |
125 | 124 |
126 checkConsistency(); | 125 checkConsistency(); |
127 } | 126 } |
128 | 127 |
129 void RenderLineBoxList::deleteLineBoxes(RenderArena* arena) | 128 void RenderLineBoxList::deleteLineBoxes() |
130 { | 129 { |
131 if (m_firstLineBox) { | 130 if (m_firstLineBox) { |
132 InlineFlowBox* next; | 131 InlineFlowBox* next; |
133 for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) { | 132 for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) { |
134 next = curr->nextLineBox(); | 133 next = curr->nextLineBox(); |
135 curr->destroy(arena); | 134 curr->destroy(); |
136 } | 135 } |
137 m_firstLineBox = 0; | 136 m_firstLineBox = 0; |
138 m_lastLineBox = 0; | 137 m_lastLineBox = 0; |
139 } | 138 } |
140 } | 139 } |
141 | 140 |
142 void RenderLineBoxList::dirtyLineBoxes() | 141 void RenderLineBoxList::dirtyLineBoxes() |
143 { | 142 { |
144 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) | 143 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) |
145 curr->dirtyLineBoxes(); | 144 curr->dirtyLineBoxes(); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 ASSERT(child->prevLineBox() == prev); | 370 ASSERT(child->prevLineBox() == prev); |
372 prev = child; | 371 prev = child; |
373 } | 372 } |
374 ASSERT(prev == m_lastLineBox); | 373 ASSERT(prev == m_lastLineBox); |
375 #endif | 374 #endif |
376 } | 375 } |
377 | 376 |
378 #endif | 377 #endif |
379 | 378 |
380 } | 379 } |
OLD | NEW |