OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (AXObjectCache* cache = node->document().existingAXObjectCache()) | 79 if (AXObjectCache* cache = node->document().existingAXObjectCache()) |
80 cache->remove(this); | 80 cache->remove(this); |
81 } | 81 } |
82 | 82 |
83 m_lineLayoutItem = LineLayoutText(nullptr); | 83 m_lineLayoutItem = LineLayoutText(nullptr); |
84 m_inlineTextBox = nullptr; | 84 m_inlineTextBox = nullptr; |
85 } | 85 } |
86 | 86 |
87 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con
st | 87 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con
st |
88 { | 88 { |
89 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; | 89 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout
()); |
90 if (!m_inlineTextBox) | 90 if (!m_inlineTextBox) |
91 return nullptr; | 91 return nullptr; |
92 | 92 |
93 return getOrCreate(m_lineLayoutItem, m_inlineTextBox->nextTextBox()); | 93 return getOrCreate(m_lineLayoutItem, m_inlineTextBox->nextTextBox()); |
94 } | 94 } |
95 | 95 |
96 LayoutRect AbstractInlineTextBox::bounds() const | 96 LayoutRect AbstractInlineTextBox::bounds() const |
97 { | 97 { |
98 if (!m_inlineTextBox || !m_lineLayoutItem) | 98 if (!m_inlineTextBox || !m_lineLayoutItem) |
99 return LayoutRect(); | 99 return LayoutRect(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 String result = m_lineLayoutItem.text().substring(start, len).simplifyWhiteS
pace(WTF::DoNotStripWhiteSpace); | 166 String result = m_lineLayoutItem.text().substring(start, len).simplifyWhiteS
pace(WTF::DoNotStripWhiteSpace); |
167 if (m_inlineTextBox->nextTextBox() && m_inlineTextBox->nextTextBox()->start(
) > m_inlineTextBox->end() && result.length() && !result.right(1).containsOnlyWh
itespace()) | 167 if (m_inlineTextBox->nextTextBox() && m_inlineTextBox->nextTextBox()->start(
) > m_inlineTextBox->end() && result.length() && !result.right(1).containsOnlyWh
itespace()) |
168 return result + " "; | 168 return result + " "; |
169 return result; | 169 return result; |
170 } | 170 } |
171 | 171 |
172 bool AbstractInlineTextBox::isFirst() const | 172 bool AbstractInlineTextBox::isFirst() const |
173 { | 173 { |
174 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; | 174 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout
()); |
175 return !m_inlineTextBox || !m_inlineTextBox->prevTextBox(); | 175 return !m_inlineTextBox || !m_inlineTextBox->prevTextBox(); |
176 } | 176 } |
177 | 177 |
178 bool AbstractInlineTextBox::isLast() const | 178 bool AbstractInlineTextBox::isLast() const |
179 { | 179 { |
180 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; | 180 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout
()); |
181 return !m_inlineTextBox || !m_inlineTextBox->nextTextBox(); | 181 return !m_inlineTextBox || !m_inlineTextBox->nextTextBox(); |
182 } | 182 } |
183 | 183 |
184 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextOnLine() const | 184 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextOnLine() const |
185 { | 185 { |
186 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; | 186 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout
()); |
187 if (!m_inlineTextBox) | 187 if (!m_inlineTextBox) |
188 return nullptr; | 188 return nullptr; |
189 | 189 |
190 InlineBox* next = m_inlineTextBox->nextOnLine(); | 190 InlineBox* next = m_inlineTextBox->nextOnLine(); |
191 if (next && next->isInlineTextBox()) | 191 if (next && next->isInlineTextBox()) |
192 return getOrCreate(toInlineTextBox(next)->lineLayoutItem(), toInlineText
Box(next)); | 192 return getOrCreate(toInlineTextBox(next)->getLineLayoutItem(), toInlineT
extBox(next)); |
193 | 193 |
194 return nullptr; | 194 return nullptr; |
195 } | 195 } |
196 | 196 |
197 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::previousOnLine() const | 197 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::previousOnLine() const |
198 { | 198 { |
199 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; | 199 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout
()); |
200 if (!m_inlineTextBox) | 200 if (!m_inlineTextBox) |
201 return nullptr; | 201 return nullptr; |
202 | 202 |
203 InlineBox* previous = m_inlineTextBox->prevOnLine(); | 203 InlineBox* previous = m_inlineTextBox->prevOnLine(); |
204 if (previous && previous->isInlineTextBox()) | 204 if (previous && previous->isInlineTextBox()) |
205 return getOrCreate(toInlineTextBox(previous)->lineLayoutItem(), toInline
TextBox(previous)); | 205 return getOrCreate(toInlineTextBox(previous)->getLineLayoutItem(), toInl
ineTextBox(previous)); |
206 | 206 |
207 return nullptr; | 207 return nullptr; |
208 } | 208 } |
209 | 209 |
210 } // namespace blink | 210 } // namespace blink |
OLD | NEW |