OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
| 3 * rights reserved. |
3 * Copyright (C) 2005 Alexey Proskuryakov. | 4 * Copyright (C) 2005 Alexey Proskuryakov. |
4 * | 5 * |
5 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
7 * are met: | 8 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 11 * 2. Redistributions in binary form must reproduce the above copyright |
11 * notice, this list of conditions and the following disclaimer in the | 12 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 13 * documentation and/or other materials provided with the distribution. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 116 |
116 void TextIteratorTextState::spliceBuffer(UChar c, | 117 void TextIteratorTextState::spliceBuffer(UChar c, |
117 Node* textNode, | 118 Node* textNode, |
118 Node* offsetBaseNode, | 119 Node* offsetBaseNode, |
119 int textStartOffset, | 120 int textStartOffset, |
120 int textEndOffset) { | 121 int textEndOffset) { |
121 DCHECK(textNode); | 122 DCHECK(textNode); |
122 m_hasEmitted = true; | 123 m_hasEmitted = true; |
123 | 124 |
124 // Remember information with which to construct the TextIterator::range(). | 125 // Remember information with which to construct the TextIterator::range(). |
125 // NOTE: textNode is often not a text node, so the range will specify child no
des of positionNode | 126 // NOTE: textNode is often not a text node, so the range will specify child |
| 127 // nodes of positionNode |
126 m_positionNode = textNode; | 128 m_positionNode = textNode; |
127 m_positionOffsetBaseNode = offsetBaseNode; | 129 m_positionOffsetBaseNode = offsetBaseNode; |
128 m_positionStartOffset = textStartOffset; | 130 m_positionStartOffset = textStartOffset; |
129 m_positionEndOffset = textEndOffset; | 131 m_positionEndOffset = textEndOffset; |
130 | 132 |
131 // remember information with which to construct the TextIterator::characters()
and length() | 133 // remember information with which to construct the TextIterator::characters() |
| 134 // and length() |
132 m_singleCharacterBuffer = c; | 135 m_singleCharacterBuffer = c; |
133 DCHECK(m_singleCharacterBuffer); | 136 DCHECK(m_singleCharacterBuffer); |
134 m_textLength = 1; | 137 m_textLength = 1; |
135 | 138 |
136 // remember some iteration state | 139 // remember some iteration state |
137 m_lastCharacter = c; | 140 m_lastCharacter = c; |
138 } | 141 } |
139 | 142 |
140 void TextIteratorTextState::emitText(Node* textNode, | 143 void TextIteratorTextState::emitText(Node* textNode, |
141 LayoutText* layoutObject, | 144 LayoutText* layoutObject, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 183 } |
181 if (positionNode()) { | 184 if (positionNode()) { |
182 flushPositionOffsets(); | 185 flushPositionOffsets(); |
183 unsigned offset = positionStartOffset() + position; | 186 unsigned offset = positionStartOffset() + position; |
184 if (string().is8Bit()) | 187 if (string().is8Bit()) |
185 output->pushRange(string().characters8() + offset, lengthToAppend); | 188 output->pushRange(string().characters8() + offset, lengthToAppend); |
186 else | 189 else |
187 output->pushRange(string().characters16() + offset, lengthToAppend); | 190 output->pushRange(string().characters16() + offset, lengthToAppend); |
188 return; | 191 return; |
189 } | 192 } |
190 NOTREACHED(); // "We shouldn't be attempting to append text that doesn't exis
t."; | 193 // We shouldn't be attempting to append text that doesn't exist. |
| 194 NOTREACHED(); |
191 } | 195 } |
192 | 196 |
193 } // namespace blink | 197 } // namespace blink |
OLD | NEW |