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

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

Issue 199103002: Better storage of HTML entities. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
Index: Source/core/html/parser/HTMLEntityParser.cpp
diff --git a/Source/core/html/parser/HTMLEntityParser.cpp b/Source/core/html/parser/HTMLEntityParser.cpp
index 7c1cddee1a3c45a1160f6a656d6d44cdaf2340c2..9866313277da4f2994a4d5c0700a0a1b65e01159 100644
--- a/Source/core/html/parser/HTMLEntityParser.cpp
+++ b/Source/core/html/parser/HTMLEntityParser.cpp
@@ -115,7 +115,7 @@ static bool consumeNamedEntity(SegmentedString& source, DecodedHTMLEntity& decod
}
notEnoughCharacters = source.isEmpty();
if (notEnoughCharacters) {
- // We can't an entity because there might be a longer entity
+ // We can't decide on an entity because there might be a longer entity
// that we could match if we had more data.
unconsumeCharacters(source, consumedCharacters);
return false;
@@ -130,11 +130,12 @@ static bool consumeNamedEntity(SegmentedString& source, DecodedHTMLEntity& decod
// actual entity.
unconsumeCharacters(source, consumedCharacters);
consumedCharacters.clear();
- const int length = entitySearch.mostRecentMatch()->length;
- const LChar* reference = entitySearch.mostRecentMatch()->entity;
+ const HTMLEntityTableEntry* mostRecent = entitySearch.mostRecentMatch();
+ const int length = mostRecent->length;
+ const LChar* reference = HTMLEntityTable::entityString(*mostRecent);
for (int i = 0; i < length; ++i) {
cc = source.currentChar();
- ASSERT_UNUSED(reference, cc == *reference++);
+ ASSERT_UNUSED(reference, cc == static_cast<UChar>(*reference++));
consumedCharacters.append(cc);
source.advanceAndASSERT(cc);
ASSERT(!source.isEmpty());
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLEntitySearch.cpp » ('j') | Source/core/html/parser/create-html-entity-table » ('J')

Powered by Google App Engine
This is Rietveld 408576698