summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 21:51:05 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 21:51:05 +0000
commit32638bfc967b411572c425840422e432a640c25a (patch)
tree4fe996f4c5bca35050c55263d0ab61dc2b7da3a6 /webkit
parent1c4446962c60801c4ab86b5592fc13653a3293ae (diff)
downloadchromium_src-32638bfc967b411572c425840422e432a640c25a.zip
chromium_src-32638bfc967b411572c425840422e432a640c25a.tar.gz
chromium_src-32638bfc967b411572c425840422e432a640c25a.tar.bz2
Fix test_shell_test failure. I had missed the fact that the generated entity code file already had "&" and ";".
Review URL: http://codereview.chromium.org/10654 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/dom_serializer.cc2
-rw-r--r--webkit/glue/entity_map.cc21
2 files changed, 16 insertions, 7 deletions
diff --git a/webkit/glue/dom_serializer.cc b/webkit/glue/dom_serializer.cc
index ca2c775..e71d8f4 100644
--- a/webkit/glue/dom_serializer.cc
+++ b/webkit/glue/dom_serializer.cc
@@ -126,7 +126,9 @@ void ConvertCorrespondingSymbolToEntity(WebCore::String* result,
// Append content before entity code.
if (cur_pos > start_pos)
result->append(start_pos, cur_pos - start_pos);
+ result->append("&");
result->append(entity_name);
+ result->append(";");
start_pos = ++cur_pos;
} else {
cur_pos++;
diff --git a/webkit/glue/entity_map.cc b/webkit/glue/entity_map.cc
index e854e6c..6c780ec 100644
--- a/webkit/glue/entity_map.cc
+++ b/webkit/glue/entity_map.cc
@@ -49,20 +49,27 @@ const EntityMapType* EntityMapData::GetEntityMapData() {
// lazily create the entity map.
map_ = new EntityMapType;
const Entity* entity_code = &entity_codes_[0];
- for (int i = 0; i < entity_codes_length_; ++i, ++entity_code)
+ for (int i = 0; i < entity_codes_length_; ++i, ++entity_code) {
+ // For consistency, use lower case for entity codes that have both.
+ EntityMapType::const_iterator it = map_->find(entity_code->code);
+ if (it != map_->end() &&
+ StringToLowerASCII(std::string(entity_code->name)) == it->second)
+ continue;
+
(*map_)[entity_code->code] = entity_code->name;
+ }
if (user_number_entity_apos_)
- (*map_)[0x0027] = "&#39;";
+ (*map_)[0x0027] = "#39";
}
return map_;
}
static const Entity xml_built_in_entity_codes[] = {
- {"&lt;", 0x003c},
- {"&gt;", 0x003e},
- {"&amp;", 0x0026},
- {"&apos;", 0x0027},
- {"&quot;", 0x0022}
+ {"lt", 0x003c},
+ {"gt", 0x003e},
+ {"amp", 0x0026},
+ {"apos", 0x0027},
+ {"quot", 0x0022}
};
static const int xml_entity_codes_length =