[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

rniwa at webkit.org rniwa at webkit.org
Wed Dec 22 12:39:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 30b508b52fb4bccbe7e36c9bef2cc4d92d8d345f
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 26 20:54:24 2010 +0000

    2010-08-26  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [chromium] WebEntities is broken
            https://bugs.webkit.org/show_bug.cgi?id=44708
    
            For serialization purposes, we don't need to convert all entity references.
            This patch modifies WebEntities::WebEntities to use hard-coded entity lists for both HTML and XML,
            and deletes populateMapFromXMLEntities and populateMapFromHTMLEntityTable.
    
            No tests are added since the code is tested in DomSerializerTests
    
            * src/WebEntities.cpp:
            (WebKit::):
            (WebKit::WebEntities::WebEntities):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 15b400e..027ca75 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-26  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [chromium] WebEntities is broken
+        https://bugs.webkit.org/show_bug.cgi?id=44708
+
+        For serialization purposes, we don't need to convert all entity references.
+        This patch modifies WebEntities::WebEntities to use hard-coded entity lists for both HTML and XML,
+        and deletes populateMapFromXMLEntities and populateMapFromHTMLEntityTable.
+
+        No tests are added since the code is tested in DomSerializerTests
+
+        * src/WebEntities.cpp:
+        (WebKit::):
+        (WebKit::WebEntities::WebEntities):
+
 2010-08-26  Peter Kasting  <pkasting at google.com>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp
index 2e05d52..bfdd9f2 100644
--- a/WebKit/chromium/src/WebEntities.cpp
+++ b/WebKit/chromium/src/WebEntities.cpp
@@ -33,7 +33,6 @@
 
 #include <string.h>
 
-#include "HTMLEntityTable.h"
 #include "PlatformString.h"
 #include "StringBuilder.h"
 #include <wtf/HashMap.h>
@@ -44,49 +43,17 @@ using namespace WebCore;
 
 namespace WebKit {
 
-namespace {
-
-void populateMapFromXMLEntities(WTF::HashMap<int, WTF::String>& map)
-{
-    ASSERT(map.isEmpty());
-    map.set(0x003c, "lt");
-    map.set(0x003e, "gt");
-    map.set(0x0026, "amp");
-    map.set(0x0027, "apos");
-    map.set(0x0022, "quot");
-}
-
-void populateMapFromHTMLEntityTable(WTF::HashMap<int, WTF::String>& map)
-{
-    ASSERT(map.isEmpty());
-    const HTMLEntityTableEntry* entry = HTMLEntityTable::firstEntry();
-    const HTMLEntityTableEntry* end = HTMLEntityTable::lastEntry() + 1;
-    for (; entry != end; ++entry) {
-        String entity = entry->entity;
-        int value = entry->value;
-        ASSERT(value && !entity.isEmpty());
-        if (entity[entity.length() - 1] != ';')
-            continue; // We want the canonical version that ends in ;
-        // For consistency, use the lower case for entities that have both.
-        if (map.contains(value) && map.get(value) == entity.lower())
-            continue;
-        // Don't register &percnt;, &nsup; and &supl; for some unknown reason.
-        if (value == '%' || value == 0x2285 || value == 0x00b9)
-            continue;
-        map.set(value, entity);
-    }
-    // We add #39 for some unknown reason.
-    map.set(0x0027, String("#39"));
-}
-
-}
-
 WebEntities::WebEntities(bool xmlEntities)
 {
-    if (xmlEntities)
-        populateMapFromXMLEntities(m_entitiesMap);
-    else
-        populateMapFromHTMLEntityTable(m_entitiesMap);
+    ASSERT(m_entitiesMap.isEmpty());
+    m_entitiesMap.set(0x003c, "lt");
+    m_entitiesMap.set(0x003e, "gt");
+    m_entitiesMap.set(0x0026, "amp");
+    m_entitiesMap.set(0x0027, "apos");
+    m_entitiesMap.set(0x0022, "quot");
+    // We add #39 for test-compatibility reason.
+    if (!xmlEntities)
+        m_entitiesMap.set(0x0027, String("#39"));
 }
 
 String WebEntities::entityNameByCode(int code) const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list