| Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
 | 
| diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
 | 
| index 5e45a354e2b5a33de171bf796289b2a97aa7bf2d..06262fb3c1c295ddda943d6406850f37a6f6d2fe 100644
 | 
| --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
 | 
| +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
 | 
| @@ -39,7 +39,8 @@ TextIteratorTextState::TextIteratorTextState(bool emitsOriginalText)
 | 
|        m_positionEndOffset(0),
 | 
|        m_hasEmitted(false),
 | 
|        m_lastCharacter(0),
 | 
| -      m_emitsOriginalText(emitsOriginalText) {}
 | 
| +      m_emitsOriginalText(emitsOriginalText),
 | 
| +      m_textStartOffset(0) {}
 | 
|  
 | 
|  UChar TextIteratorTextState::characterAt(unsigned index) const {
 | 
|    SECURITY_DCHECK(index < static_cast<unsigned>(length()));
 | 
| @@ -95,12 +96,14 @@ void TextIteratorTextState::updateForReplacedElement(Node* baseNode) {
 | 
|  
 | 
|    m_textLength = 0;
 | 
|    m_lastCharacter = 0;
 | 
| +  m_textStartOffset = 0;
 | 
|  }
 | 
|  
 | 
|  void TextIteratorTextState::emitAltText(Node* node) {
 | 
|    m_text = toHTMLElement(node)->altText();
 | 
|    m_textLength = m_text.length();
 | 
|    m_lastCharacter = m_textLength ? m_text[m_textLength - 1] : 0;
 | 
| +  m_textStartOffset = 0;
 | 
|  }
 | 
|  
 | 
|  void TextIteratorTextState::flushPositionOffsets() const {
 | 
| @@ -136,6 +139,7 @@ void TextIteratorTextState::spliceBuffer(UChar c,
 | 
|  
 | 
|    // remember some iteration state
 | 
|    m_lastCharacter = c;
 | 
| +  m_textStartOffset = 0;
 | 
|  }
 | 
|  
 | 
|  void TextIteratorTextState::emitText(Node* textNode,
 | 
| @@ -161,6 +165,7 @@ void TextIteratorTextState::emitText(Node* textNode,
 | 
|    m_lastCharacter = m_text[textEndOffset - 1];
 | 
|  
 | 
|    m_hasEmitted = true;
 | 
| +  m_textStartOffset = layoutObject->textStartOffset();
 | 
|  }
 | 
|  
 | 
|  void TextIteratorTextState::appendTextTo(ForwardsTextBuffer* output,
 | 
| 
 |