Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: Source/core/html/parser/HTMLSourceTracker.cpp

Issue 351353005: Fix: view-source fails to display < near chunk boundaries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/HTMLSourceTracker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLSourceTracker.cpp
diff --git a/Source/core/html/parser/HTMLSourceTracker.cpp b/Source/core/html/parser/HTMLSourceTracker.cpp
index af729fa4dc87ebd36dac4b7a53590a37dcaeeb9a..35511d3c809d5fac78ecb9d2506981e548bcd085 100644
--- a/Source/core/html/parser/HTMLSourceTracker.cpp
+++ b/Source/core/html/parser/HTMLSourceTracker.cpp
@@ -32,24 +32,28 @@
namespace WebCore {
HTMLSourceTracker::HTMLSourceTracker()
+ : m_isStarted(false)
{
}
void HTMLSourceTracker::start(SegmentedString& currentInput, HTMLTokenizer* tokenizer, HTMLToken& token)
{
- if (token.type() == HTMLToken::Uninitialized) {
+ if (token.type() == HTMLToken::Uninitialized && !m_isStarted) {
m_previousSource.clear();
if (tokenizer->numberOfBufferedCharacters())
m_previousSource = tokenizer->bufferedCharacters();
} else
m_previousSource.append(m_currentSource);
+ m_isStarted = true;
m_currentSource = currentInput;
token.setBaseOffset(m_currentSource.numberOfCharactersConsumed() - m_previousSource.length());
}
void HTMLSourceTracker::end(SegmentedString& currentInput, HTMLTokenizer* tokenizer, HTMLToken& token)
{
+ m_isStarted = false;
+
m_cachedSourceForToken = String();
// FIXME: This work should really be done by the HTMLTokenizer.
« no previous file with comments | « Source/core/html/parser/HTMLSourceTracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698