diff options
Diffstat (limited to 'WebCore/html/HTMLViewSourceParser.cpp')
-rw-r--r-- | WebCore/html/HTMLViewSourceParser.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/WebCore/html/HTMLViewSourceParser.cpp b/WebCore/html/HTMLViewSourceParser.cpp index 3da4c23..8a7984d 100644 --- a/WebCore/html/HTMLViewSourceParser.cpp +++ b/WebCore/html/HTMLViewSourceParser.cpp @@ -32,6 +32,12 @@ namespace WebCore { +HTMLViewSourceParser::HTMLViewSourceParser(HTMLViewSourceDocument* document) + : DecodedDataDocumentParser(document) + , m_tokenizer(HTMLTokenizer::create()) +{ +} + HTMLViewSourceParser::~HTMLViewSourceParser() { } @@ -43,7 +49,7 @@ void HTMLViewSourceParser::insert(const SegmentedString&) void HTMLViewSourceParser::pumpTokenizer() { - while (m_tokenizer.nextToken(m_input.current(), m_token)) { + while (m_tokenizer->nextToken(m_input.current(), m_token)) { m_token.end(m_input.current().numberOfCharactersConsumed()); document()->addSource(sourceForToken(), m_token); updateTokenizerState(); @@ -81,12 +87,12 @@ void HTMLViewSourceParser::updateTokenizerState() return; AtomicString tagName(m_token.name().data(), m_token.name().size()); - m_tokenizer.setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer.state(), tagName, m_document->frame())); + m_tokenizer->setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer->state(), tagName, document()->frame())); if (tagName == HTMLNames::scriptTag) { // The tree builder handles scriptTag separately from the other tokenizer // state adjustments, so we need to handle it separately too. - ASSERT(m_tokenizer.state() == HTMLTokenizer::DataState); - m_tokenizer.setState(HTMLTokenizer::ScriptDataState); + ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState); + m_tokenizer->setState(HTMLTokenizer::ScriptDataState); } } |