https://bugs.webkit.org/show_bug.cgi?id=121176
Reviewed by Anders Carlsson.
Use LChar instead.
* html/parser/HTMLEntityParser.cpp:
(WebCore::HTMLEntityParser::consumeNamedEntity):
* html/parser/HTMLEntityTable.h:
(WebCore::HTMLEntityTableEntry::lastCharacter):
* html/parser/create-html-entity-table:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155559
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-09-11 Ryosuke Niwa <rniwa@webkit.org>
+
+ HTMLEntityTable could use char to reduce binary size
+ https://bugs.webkit.org/show_bug.cgi?id=121176
+
+ Reviewed by Anders Carlsson.
+
+ Use LChar instead.
+
+ * html/parser/HTMLEntityParser.cpp:
+ (WebCore::HTMLEntityParser::consumeNamedEntity):
+ * html/parser/HTMLEntityTable.h:
+ (WebCore::HTMLEntityTableEntry::lastCharacter):
+ * html/parser/create-html-entity-table:
+
2013-09-11 Brent Fulgham <bfulgham@apple.com>
[Windows] Revise GDI Create Functions to use GDIObject Smart Pointer.
unconsumeCharacters(source, consumedCharacters);
consumedCharacters.clear();
const int length = entitySearch.mostRecentMatch()->length;
- const UChar* reference = entitySearch.mostRecentMatch()->entity;
+ const LChar* reference = entitySearch.mostRecentMatch()->entity;
for (int i = 0; i < length; ++i) {
cc = source.currentChar();
ASSERT_UNUSED(reference, cc == *reference++);
namespace WebCore {
struct HTMLEntityTableEntry {
- UChar lastCharacter() const { return entity[length - 1]; }
+ LChar lastCharacter() const { return entity[length - 1]; }
- const UChar* entity;
+ const LChar* entity;
int length;
UChar32 firstValue;
UChar32 secondValue;
return "%s%s" % (entity, postfix)
-def convert_entity_to_uchar_array(entity):
- return "{'%s'}" % "', '".join(entity)
-
-
def convert_value_to_int(value):
if not value:
return "0";
output_file.write("""/*
* Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ * Copyright (C) 2013 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
""")
for entry in entries:
- output_file.write("static const UChar %s[] = %s;\n" % (
- convert_entity_to_cpp_name(entry[ENTITY]),
- convert_entity_to_uchar_array(entry[ENTITY])))
+ output_file.write("static const LChar %s[] = \"%s\";\n" % (convert_entity_to_cpp_name(entry[ENTITY]), entry[ENTITY]))
output_file.write("""
static const HTMLEntityTableEntry staticEntityTable[%s] = {\n""" % entity_count)