void HTMLSourceTracker::start(SegmentedString& currentInput, HTMLTokenizer* tokenizer, HTMLToken& token) { if (token.type() == HTMLToken::Uninitialized) { m_previousSource.clear(); if (tokenizer->numberOfBufferedCharacters()) m_previousSource = tokenizer->bufferedCharacters(); } else m_previousSource.append(m_currentSource); m_currentSource = currentInput; token.setBaseOffset(m_currentSource.numberOfCharactersConsumed() - m_previousSource.length()); }
void HTMLSourceTracker::start(const HTMLInputStream& input, HTMLTokenizer* tokenizer, HTMLToken& token) { if (token.type() == HTMLTokenTypes::Uninitialized) { m_previousSource.clear(); if (tokenizer->numberOfBufferedCharacters()) m_previousSource = tokenizer->bufferedCharacters(); } else m_previousSource.append(m_currentSource); m_currentSource = input.current(); token.setBaseOffset(m_currentSource.numberOfCharactersConsumed() - m_previousSource.length()); }