| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (AXObjectCache* cache = node->document().existingAXObjectCache()) | 80 if (AXObjectCache* cache = node->document().existingAXObjectCache()) |
| 81 cache->remove(this); | 81 cache->remove(this); |
| 82 } | 82 } |
| 83 | 83 |
| 84 m_layoutText = 0; | 84 m_layoutText = 0; |
| 85 m_inlineTextBox = 0; | 85 m_inlineTextBox = 0; |
| 86 } | 86 } |
| 87 | 87 |
| 88 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con
st | 88 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con
st |
| 89 { | 89 { |
| 90 ASSERT(!m_inlineTextBox || !m_inlineTextBox->layoutObject().needsLayout()); | 90 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; |
| 91 if (!m_inlineTextBox) | 91 if (!m_inlineTextBox) |
| 92 return nullptr; | 92 return nullptr; |
| 93 | 93 |
| 94 return getOrCreate(m_layoutText, m_inlineTextBox->nextTextBox()); | 94 return getOrCreate(m_layoutText, m_inlineTextBox->nextTextBox()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 LayoutRect AbstractInlineTextBox::bounds() const | 97 LayoutRect AbstractInlineTextBox::bounds() const |
| 98 { | 98 { |
| 99 if (!m_inlineTextBox || !m_layoutText) | 99 if (!m_inlineTextBox || !m_layoutText) |
| 100 return LayoutRect(); | 100 return LayoutRect(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 String result = m_layoutText->text().substring(start, len).simplifyWhiteSpac
e(WTF::DoNotStripWhiteSpace); | 167 String result = m_layoutText->text().substring(start, len).simplifyWhiteSpac
e(WTF::DoNotStripWhiteSpace); |
| 168 if (m_inlineTextBox->nextTextBox() && m_inlineTextBox->nextTextBox()->start(
) > m_inlineTextBox->end() && result.length() && !result.right(1).containsOnlyWh
itespace()) | 168 if (m_inlineTextBox->nextTextBox() && m_inlineTextBox->nextTextBox()->start(
) > m_inlineTextBox->end() && result.length() && !result.right(1).containsOnlyWh
itespace()) |
| 169 return result + " "; | 169 return result + " "; |
| 170 return result; | 170 return result; |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool AbstractInlineTextBox::isFirst() const | 173 bool AbstractInlineTextBox::isFirst() const |
| 174 { | 174 { |
| 175 ASSERT(!m_inlineTextBox || !m_inlineTextBox->layoutObject().needsLayout()); | 175 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; |
| 176 return !m_inlineTextBox || !m_inlineTextBox->prevTextBox(); | 176 return !m_inlineTextBox || !m_inlineTextBox->prevTextBox(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool AbstractInlineTextBox::isLast() const | 179 bool AbstractInlineTextBox::isLast() const |
| 180 { | 180 { |
| 181 ASSERT(!m_inlineTextBox || !m_inlineTextBox->layoutObject().needsLayout()); | 181 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; |
| 182 return !m_inlineTextBox || !m_inlineTextBox->nextTextBox(); | 182 return !m_inlineTextBox || !m_inlineTextBox->nextTextBox(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextOnLine() const | 185 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextOnLine() const |
| 186 { | 186 { |
| 187 ASSERT(!m_inlineTextBox || !m_inlineTextBox->layoutObject().needsLayout()); | 187 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; |
| 188 if (!m_inlineTextBox) | 188 if (!m_inlineTextBox) |
| 189 return nullptr; | 189 return nullptr; |
| 190 | 190 |
| 191 InlineBox* next = m_inlineTextBox->nextOnLine(); | 191 InlineBox* next = m_inlineTextBox->nextOnLine(); |
| 192 if (next && next->isInlineTextBox()) | 192 if (next && next->isInlineTextBox()) |
| 193 return getOrCreate(&toInlineTextBox(next)->layoutObject(), toInlineTextB
ox(next)); | 193 return getOrCreate(&toInlineTextBox(next)->layoutObject(), toInlineTextB
ox(next)); |
| 194 | 194 |
| 195 return nullptr; | 195 return nullptr; |
| 196 } | 196 } |
| 197 | 197 |
| 198 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::previousOnLine() const | 198 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::previousOnLine() const |
| 199 { | 199 { |
| 200 ASSERT(!m_inlineTextBox || !m_inlineTextBox->layoutObject().needsLayout()); | 200 ASSERT(!m_inlineTextBox || !m_inlineTextBox->lineLayoutItem().needsLayout())
; |
| 201 if (!m_inlineTextBox) | 201 if (!m_inlineTextBox) |
| 202 return nullptr; | 202 return nullptr; |
| 203 | 203 |
| 204 InlineBox* previous = m_inlineTextBox->prevOnLine(); | 204 InlineBox* previous = m_inlineTextBox->prevOnLine(); |
| 205 if (previous && previous->isInlineTextBox()) | 205 if (previous && previous->isInlineTextBox()) |
| 206 return getOrCreate(&toInlineTextBox(previous)->layoutObject(), toInlineT
extBox(previous)); | 206 return getOrCreate(&toInlineTextBox(previous)->layoutObject(), toInlineT
extBox(previous)); |
| 207 | 207 |
| 208 return nullptr; | 208 return nullptr; |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace blink | 211 } // namespace blink |
| OLD | NEW |