Log Message
Unreviewed, rolling out r195911. https://bugs.webkit.org/show_bug.cgi?id=153723
Caused frequent assertion failures on bots (Requested by ap on #webkit). Reverted changeset: "Replace CaseFoldingHash with ASCIICaseInsensitiveHash" https://bugs.webkit.org/show_bug.cgi?id=153639 http://trac.webkit.org/changeset/195911
Modified Paths
- trunk/Source/WTF/ChangeLog
- trunk/Source/WTF/wtf/text/StringHash.h
- trunk/Source/WTF/wtf/text/StringImpl.cpp
- trunk/Source/WTF/wtf/text/StringImpl.h
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h
- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
- trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
- trunk/Source/WebCore/css/CSSFontSelector.cpp
- trunk/Source/WebCore/css/CSSFontSelector.h
- trunk/Source/WebCore/dom/DOMImplementation.cpp
- trunk/Source/WebCore/dom/Document.h
- trunk/Source/WebCore/dom/ScriptElement.cpp
- trunk/Source/WebCore/editing/EditorCommand.cpp
- trunk/Source/WebCore/html/HTMLObjectElement.cpp
- trunk/Source/WebCore/html/InputType.cpp
- trunk/Source/WebCore/loader/CrossOriginAccessControl.h
- trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.h
- trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp
- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
- trunk/Source/WebCore/platform/SchemeRegistry.h
- trunk/Source/WebCore/platform/URL.cpp
- trunk/Source/WebCore/platform/graphics/FontCache.cpp
- trunk/Source/WebCore/platform/graphics/FontCascade.cpp
- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
- trunk/Source/WebCore/platform/network/HTTPHeaderMap.h
- trunk/Source/WebCore/rendering/style/RenderStyle.cpp
- trunk/Source/WebKit/win/ChangeLog
- trunk/Source/WebKit/win/WebCoreStatistics.cpp
- trunk/Source/WebKit/win/WebURLResponse.cpp
- trunk/Source/WebKit2/ChangeLog
- trunk/Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm
- trunk/Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h
- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
- trunk/Source/WebKit2/WebProcess/WebProcess.cpp
- trunk/Tools/ChangeLog
- trunk/Tools/Scripts/do-webcore-rename
Diff
Modified: trunk/Source/WTF/ChangeLog (195916 => 195917)
--- trunk/Source/WTF/ChangeLog 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WTF/ChangeLog 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,3 +1,17 @@
+2016-01-30 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r195911.
+ https://bugs.webkit.org/show_bug.cgi?id=153723
+
+ Caused frequent assertion failures on bots (Requested by ap on
+ #webkit).
+
+ Reverted changeset:
+
+ "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+ https://bugs.webkit.org/show_bug.cgi?id=153639
+ http://trac.webkit.org/changeset/195911
+
2016-01-30 Darin Adler <[email protected]>
Replace CaseFoldingHash with ASCIICaseInsensitiveHash
Modified: trunk/Source/WTF/wtf/text/StringHash.h (195916 => 195917)
--- trunk/Source/WTF/wtf/text/StringHash.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WTF/wtf/text/StringHash.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2008, 2012-2013, 2016 Apple Inc. All rights reserved
+ * Copyright (C) 2006, 2007, 2008, 2012, 2013 Apple Inc. All rights reserved
* Copyright (C) Research In Motion Limited 2009. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@
return value.isNull();
}
- // The hash() functions on StringHash and ASCIICaseInsensitiveHash do not support
+ // The hash() functions on StringHash and CaseFoldingHash do not support
// null strings. get(), contains(), and add() on HashMap<String,..., StringHash>
// cause a null-pointer dereference when passed null strings.
@@ -71,11 +71,14 @@
static const bool safeToCompareToEmptyOrDeleted = false;
};
- class ASCIICaseInsensitiveHash {
+ class CaseFoldingHash {
public:
template<typename T> static inline UChar foldCase(T character)
{
- return toASCIILower(character);
+ if (std::is_same<T, LChar>::value)
+ return StringImpl::latin1CaseFoldTable[character];
+
+ return u_foldCase(character, U_FOLD_CASE_DEFAULT);
}
static unsigned hash(const UChar* data, unsigned length)
@@ -102,23 +105,17 @@
static inline unsigned hash(const char* data, unsigned length)
{
- return hash(reinterpret_cast<const LChar*>(data), length);
+ return CaseFoldingHash::hash(reinterpret_cast<const LChar*>(data), length);
}
- static inline bool equal(const StringImpl& a, const StringImpl& b)
- {
- return equalIgnoringASCIICase(a, b);
- }
static inline bool equal(const StringImpl* a, const StringImpl* b)
{
- ASSERT(a);
- ASSERT(b);
- return equal(*a, *b);
+ return equalCompatibiltyCaselessNonNull(a, b);
}
static unsigned hash(const RefPtr<StringImpl>& key)
{
- return hash(key.get());
+ return hash(*key);
}
static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
@@ -170,8 +167,8 @@
}
-using WTF::ASCIICaseInsensitiveHash;
using WTF::AlreadyHashed;
+using WTF::CaseFoldingHash;
using WTF::StringHash;
#endif
Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (195916 => 195917)
--- trunk/Source/WTF/wtf/text/StringImpl.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -950,50 +950,30 @@
return charactersToFloat(characters16(), m_length, ok);
}
-// Table is based on ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt
-static const UChar latin1CaseFoldTable[256] = {
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
- 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
- 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
- 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
-};
-
-static inline bool equalCompatibilityCaseless(const LChar* a, const LChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const LChar* a, const LChar* b, unsigned length)
{
while (length--) {
- if (latin1CaseFoldTable[*a++] != latin1CaseFoldTable[*b++])
+ if (StringImpl::latin1CaseFoldTable[*a++] != StringImpl::latin1CaseFoldTable[*b++])
return false;
}
return true;
}
-static inline bool equalCompatibilityCaseless(const UChar* a, const LChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const UChar* a, const LChar* b, unsigned length)
{
while (length--) {
- if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != latin1CaseFoldTable[*b++])
+ if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != StringImpl::latin1CaseFoldTable[*b++])
return false;
}
return true;
}
-static inline bool equalCompatibilityCaseless(const LChar* a, const UChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const LChar* a, const UChar* b, unsigned length)
{
- return equalCompatibilityCaseless(b, a, length);
+ return equalCompatibiltyCaseless(b, a, length);
}
-static inline bool equalCompatibilityCaseless(const UChar* a, const UChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const UChar* a, const UChar* b, unsigned length)
{
return !u_memcasecmp(a, b, length, U_FOLD_CASE_DEFAULT);
}
@@ -1102,7 +1082,7 @@
const LChar* searchCharacters = characters8() + index;
unsigned i = 0;
- while (!equalCompatibilityCaseless(searchCharacters + i, matchString, matchLength)) {
+ while (!equalCompatibiltyCaseless(searchCharacters + i, matchString, matchLength)) {
if (i == delta)
return notFound;
++i;
@@ -1113,7 +1093,7 @@
const UChar* searchCharacters = characters16() + index;
unsigned i = 0;
- while (!equalCompatibilityCaseless(searchCharacters + i, matchString, matchLength)) {
+ while (!equalCompatibiltyCaseless(searchCharacters + i, matchString, matchLength)) {
if (i == delta)
return notFound;
++i;
@@ -1177,7 +1157,7 @@
unsigned i = 0;
// keep looping until we match
- while (!equalCompatibilityCaseless(searchCharacters + i, matchCharacters, matchLength)) {
+ while (!equalCompatibiltyCaseless(searchCharacters + i, matchCharacters, matchLength)) {
if (i == delta)
return notFound;
++i;
@@ -1318,7 +1298,7 @@
unsigned delta = std::min(index, length - matchLength);
// keep looping until we match
- while (!equalCompatibilityCaseless(searchCharacters + delta, matchCharacters, matchLength)) {
+ while (!equalCompatibiltyCaseless(searchCharacters + delta, matchCharacters, matchLength)) {
if (!delta)
return notFound;
--delta;
@@ -1364,8 +1344,8 @@
return equal(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
}
if (stringImpl->is8Bit())
- return equalCompatibilityCaseless(stringImpl->characters8() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
- return equalCompatibilityCaseless(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
+ return equalCompatibiltyCaseless(stringImpl->characters8() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
+ return equalCompatibiltyCaseless(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
}
ALWAYS_INLINE static bool equalInner(const StringImpl& stringImpl, unsigned startOffset, const StringImpl& matchString)
@@ -1938,6 +1918,30 @@
return equalCommon(a, b);
}
+bool equalCompatibiltyCaselessNonNull(const StringImpl* a, const StringImpl* b)
+{
+ ASSERT(a);
+ ASSERT(b);
+ if (a == b)
+ return true;
+
+ unsigned length = a->length();
+ if (length != b->length())
+ return false;
+
+ if (a->is8Bit()) {
+ if (b->is8Bit())
+ return equalCompatibiltyCaseless(a->characters8(), b->characters8(), length);
+
+ return equalCompatibiltyCaseless(b->characters16(), a->characters8(), length);
+ }
+
+ if (b->is8Bit())
+ return equalCompatibiltyCaseless(a->characters16(), b->characters8(), length);
+
+ return equalCompatibiltyCaseless(a->characters16(), b->characters16(), length);
+}
+
bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
{
if (!a && b && !b->length())
@@ -2137,6 +2141,26 @@
return utf8ForRange(0, length(), mode);
}
+// Table is based on ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt
+const UChar StringImpl::latin1CaseFoldTable[256] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+ 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
+};
+
bool equalIgnoringNullity(const UChar* a, size_t aLength, StringImpl* b)
{
if (!b)
Modified: trunk/Source/WTF/wtf/text/StringImpl.h (195916 => 195917)
--- trunk/Source/WTF/wtf/text/StringImpl.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WTF/wtf/text/StringImpl.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -762,6 +762,8 @@
ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
#endif
+ WTF_EXPORT_STRING_API static const UChar latin1CaseFoldTable[256];
+
Ref<StringImpl> extractFoldedStringInSymbol()
{
ASSERT(isSymbol());
@@ -944,6 +946,9 @@
inline bool equal(const char* a, StringImpl* b) { return equal(b, reinterpret_cast<const LChar*>(a)); }
WTF_EXPORT_STRING_API bool equal(const StringImpl& a, const StringImpl& b);
+// FIXME: Deprecated. Used only by CaseFoldingHash, which itself is soon to be deprecated and removed, replaced by ASCIICaseFoldingHash.
+WTF_EXPORT_STRING_API bool equalCompatibiltyCaselessNonNull(const StringImpl*, const StringImpl*);
+
WTF_EXPORT_STRING_API bool equalIgnoringNullity(StringImpl*, StringImpl*);
WTF_EXPORT_STRING_API bool equalIgnoringNullity(const UChar*, size_t length, StringImpl*);
Modified: trunk/Source/WebCore/ChangeLog (195916 => 195917)
--- trunk/Source/WebCore/ChangeLog 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/ChangeLog 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,5 +1,19 @@
2016-01-30 Commit Queue <[email protected]>
+ Unreviewed, rolling out r195911.
+ https://bugs.webkit.org/show_bug.cgi?id=153723
+
+ Caused frequent assertion failures on bots (Requested by ap on
+ #webkit).
+
+ Reverted changeset:
+
+ "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+ https://bugs.webkit.org/show_bug.cgi?id=153639
+ http://trac.webkit.org/changeset/195911
+
+2016-01-30 Commit Queue <[email protected]>
+
Unreviewed, rolling out r195799 and r195828.
https://bugs.webkit.org/show_bug.cgi?id=153722
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h (195916 => 195917)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -117,7 +117,7 @@
const String m_databaseInfoTableName;
- HashSet<String, ASCIICaseInsensitiveHash> m_whitelistedFunctions;
+ HashSet<String, CaseFoldingHash> m_whitelistedFunctions;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (195916 => 195917)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1988,7 +1988,7 @@
return nullptr;
}
-typedef HashMap<String, AccessibilityRole, ASCIICaseInsensitiveHash> ARIARoleMap;
+typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap;
typedef HashMap<AccessibilityRole, String, DefaultHash<int>::Hash, WTF::UnsignedWithZeroKeyHashTraits<int>> ARIAReverseRoleMap;
static ARIARoleMap* gAriaRoleMap = nullptr;
Modified: trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.h (195916 => 195917)
--- trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/crypto/CryptoAlgorithmRegistry.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -65,7 +65,7 @@
void registerAlgorithm(const String& name, CryptoAlgorithmIdentifier, CryptoAlgorithmConstructor);
- HashMap<String, CryptoAlgorithmIdentifier, ASCIICaseInsensitiveHash> m_nameToIdentifierMap;
+ HashMap<String, CryptoAlgorithmIdentifier, CaseFoldingHash> m_nameToIdentifierMap;
HashMap<unsigned, String> m_identifierToNameMap;
HashMap<unsigned, CryptoAlgorithmConstructor> m_identifierToConstructorMap;
};
Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (195916 => 195917)
--- trunk/Source/WebCore/css/CSSFontSelector.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -224,7 +224,7 @@
}
}
-static void registerLocalFontFacesForFamily(const String& familyName, HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash>& locallyInstalledFontFaces)
+static void registerLocalFontFacesForFamily(const String& familyName, HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash>& locallyInstalledFontFaces)
{
ASSERT(!locallyInstalledFontFaces.contains(familyName));
Modified: trunk/Source/WebCore/css/CSSFontSelector.h (195916 => 195917)
--- trunk/Source/WebCore/css/CSSFontSelector.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/css/CSSFontSelector.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -86,9 +86,9 @@
void beginLoadTimerFired();
Document* m_document;
- HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_fontFaces;
- HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_locallyInstalledFontFaces;
- HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, ASCIICaseInsensitiveHash> m_fonts;
+ HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_fontFaces;
+ HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_locallyInstalledFontFaces;
+ HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, CaseFoldingHash> m_fonts;
HashSet<FontSelectorClient*> m_clients;
Vector<CachedResourceHandle<CachedFont>> m_fontsToBeginLoading;
Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (195916 => 195917)
--- trunk/Source/WebCore/dom/DOMImplementation.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -64,7 +64,7 @@
using namespace HTMLNames;
-typedef HashSet<String, ASCIICaseInsensitiveHash> FeatureSet;
+typedef HashSet<String, CaseFoldingHash> FeatureSet;
static void addString(FeatureSet& set, const char* string)
{
Modified: trunk/Source/WebCore/dom/Document.h (195916 => 195917)
--- trunk/Source/WebCore/dom/Document.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/dom/Document.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1613,7 +1613,7 @@
HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements;
#endif
- HashMap<StringImpl*, Element*, ASCIICaseInsensitiveHash> m_elementsByAccessKey;
+ HashMap<StringImpl*, Element*, CaseFoldingHash> m_elementsByAccessKey;
bool m_accessKeyMapValid;
DocumentOrderedMap m_imagesByUsemap;
Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (195916 => 195917)
--- trunk/Source/WebCore/dom/ScriptElement.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -118,7 +118,7 @@
// We want to accept all the values that either of these browsers accept, but not other values.
// FIXME: This function is not HTML5 compliant. These belong in the MIME registry as "text/_javascript_<version>" entries.
- typedef HashSet<String, ASCIICaseInsensitiveHash> LanguageSet;
+ typedef HashSet<String, CaseFoldingHash> LanguageSet;
static NeverDestroyed<LanguageSet> languages;
if (languages.get().isEmpty()) {
languages.get().add("_javascript_");
Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (195916 => 195917)
--- trunk/Source/WebCore/editing/EditorCommand.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -77,7 +77,7 @@
bool allowExecutionWhenDisabled;
};
-typedef HashMap<String, const EditorInternalCommand*, ASCIICaseInsensitiveHash> CommandMap;
+typedef HashMap<String, const EditorInternalCommand*, CaseFoldingHash> CommandMap;
static const bool notTextInsertion = false;
static const bool isTextInsertion = true;
Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (195916 => 195917)
--- trunk/Source/WebCore/html/HTMLObjectElement.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -166,7 +166,7 @@
// FIXME: This function should not deal with url or serviceType!
void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType)
{
- HashSet<StringImpl*, ASCIICaseInsensitiveHash> uniqueParamNames;
+ HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
String urlParameter;
// Scan the PARAM children and store their name/value pairs.
Modified: trunk/Source/WebCore/html/InputType.cpp (195916 => 195917)
--- trunk/Source/WebCore/html/InputType.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/html/InputType.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -86,7 +86,7 @@
typedef bool (RuntimeEnabledFeatures::*InputTypeConditionalFunction)() const;
typedef const AtomicString& (*InputTypeNameFunction)();
typedef std::unique_ptr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
-typedef HashMap<AtomicString, InputTypeFactoryFunction, ASCIICaseInsensitiveHash> InputTypeFactoryMap;
+typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
template<class T>
static std::unique_ptr<InputType> createInputType(HTMLInputElement& element)
Modified: trunk/Source/WebCore/loader/CrossOriginAccessControl.h (195916 => 195917)
--- trunk/Source/WebCore/loader/CrossOriginAccessControl.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/loader/CrossOriginAccessControl.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -34,7 +34,7 @@
namespace WebCore {
-typedef HashSet<String, ASCIICaseInsensitiveHash> HTTPHeaderSet;
+typedef HashSet<String, CaseFoldingHash> HTTPHeaderSet;
class HTTPHeaderMap;
enum class HTTPHeaderName;
Modified: trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.h (195916 => 195917)
--- trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -59,7 +59,7 @@
std::chrono::steady_clock::time_point m_absoluteExpiryTime;
StoredCredentials m_credentials;
HashSet<String> m_methods;
- HashSet<String, ASCIICaseInsensitiveHash> m_headers;
+ HashSet<String, CaseFoldingHash> m_headers;
};
class CrossOriginPreflightResultCache {
Modified: trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp (195916 => 195917)
--- trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -47,7 +47,7 @@
namespace WebCore {
typedef PassRefPtr<Archive> RawDataCreationFunction(const URL&, SharedBuffer*);
-typedef HashMap<String, RawDataCreationFunction*, ASCIICaseInsensitiveHash> ArchiveMIMETypesMap;
+typedef HashMap<String, RawDataCreationFunction*, CaseFoldingHash> ArchiveMIMETypesMap;
// The create functions in the archive classes return PassRefPtr to concrete subclasses
// of Archive. This adaptor makes the functions have a uniform return type.
Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (195916 => 195917)
--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -150,7 +150,7 @@
static HashSet<String>* pdfAndPostScriptMIMETypes;
static HashSet<String>* unsupportedTextMIMETypes;
-typedef HashMap<String, Vector<String>*, ASCIICaseInsensitiveHash> MediaMIMETypeMap;
+typedef HashMap<String, Vector<String>*, CaseFoldingHash> MediaMIMETypeMap;
static void initializeSupportedImageMIMETypes()
{
Modified: trunk/Source/WebCore/platform/SchemeRegistry.h (195916 => 195917)
--- trunk/Source/WebCore/platform/SchemeRegistry.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/SchemeRegistry.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -32,7 +32,7 @@
namespace WebCore {
-typedef HashSet<String, ASCIICaseInsensitiveHash> URLSchemesMap;
+typedef HashSet<String, CaseFoldingHash> URLSchemesMap;
class SchemeRegistry {
public:
Modified: trunk/Source/WebCore/platform/URL.cpp (195916 => 195917)
--- trunk/Source/WebCore/platform/URL.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/URL.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1990,7 +1990,7 @@
return protocolIs("about");
}
-typedef HashMap<String, unsigned short, ASCIICaseInsensitiveHash> DefaultPortsMap;
+typedef HashMap<String, unsigned short, CaseFoldingHash> DefaultPortsMap;
static const DefaultPortsMap& defaultPortsMap()
{
static NeverDestroyed<const DefaultPortsMap> defaultPortsMap(DefaultPortsMap({
Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (195916 => 195917)
--- trunk/Source/WebCore/platform/graphics/FontCache.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -97,47 +97,51 @@
}
struct FontPlatformDataCacheKey {
- AtomicString family;
- FontDescriptionKey description;
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ FontPlatformDataCacheKey() { }
+ FontPlatformDataCacheKey(const AtomicString& family, const FontDescription& description)
+ : m_fontDescriptionKey(description)
+ , m_family(family)
+ { }
- FontPlatformDataCacheKey() = default;
- FontPlatformDataCacheKey(const AtomicString& family, const FontDescription& description)
- : family(family), description(description)
+ explicit FontPlatformDataCacheKey(HashTableDeletedValueType t)
+ : m_fontDescriptionKey(t)
+ { }
+
+ bool isHashTableDeletedValue() const { return m_fontDescriptionKey.isHashTableDeletedValue(); }
+
+ bool operator==(const FontPlatformDataCacheKey& other) const
{
+ if (m_fontDescriptionKey != other.m_fontDescriptionKey)
+ return false;
+ if (m_family.impl() == other.m_family.impl())
+ return true;
+ if (m_family.isNull() || other.m_family.isNull())
+ return false;
+ return CaseFoldingHash::equal(m_family, other.m_family);
}
- explicit FontPlatformDataCacheKey(HashTableDeletedValueType)
- : description(HashTableDeletedValue)
- {
- }
- bool isHashTableDeletedValue() const
- {
- return description.isHashTableDeletedValue();
- }
+ FontDescriptionKey m_fontDescriptionKey;
+ AtomicString m_family;
};
struct FontPlatformDataCacheKeyHash {
- static unsigned hash(const FontPlatformDataCacheKey& key)
+ static unsigned hash(const FontPlatformDataCacheKey& fontKey)
{
- return pairIntHash(ASCIICaseInsensitiveHash::hash(key.family), key.description.computeHash());
+ return pairIntHash(CaseFoldingHash::hash(fontKey.m_family), fontKey.m_fontDescriptionKey.computeHash());
}
+
static bool equal(const FontPlatformDataCacheKey& a, const FontPlatformDataCacheKey& b)
{
- return a.description == b.description && equalIgnoringASCIICase(a.family, b.family);
+ return a == b;
}
+
static const bool safeToCompareToEmptyOrDeleted = true;
};
-struct FontPlatformDataCacheKeyTraits : SimpleClassHashTraits<FontPlatformDataCacheKey> {
- static const bool hasIsEmptyValueFunction = true;
- static bool isEmptyValue(const FontPlatformDataCacheKey& key)
- {
- return key.family.isNull();
- }
-};
+typedef HashMap<FontPlatformDataCacheKey, std::unique_ptr<FontPlatformData>, FontPlatformDataCacheKeyHash, WTF::SimpleClassHashTraits<FontPlatformDataCacheKey>> FontPlatformDataCache;
-typedef HashMap<FontPlatformDataCacheKey, std::unique_ptr<FontPlatformData>, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits> FontPlatformDataCache;
-
static FontPlatformDataCache& fontPlatformDataCache()
{
static NeverDestroyed<FontPlatformDataCache> cache;
@@ -203,9 +207,9 @@
return nullAtom;
}
-// FIXME: This function name should not have the word "get" in it for WebKit coding style.
-// FIXME: The boolean here is poor coding style. Easy to factor this into two functions so we don't need it.
-FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription, const AtomicString& passedFamilyName, bool checkingAlternateName)
+FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription,
+ const AtomicString& passedFamilyName,
+ bool checkingAlternateName)
{
#if PLATFORM(IOS)
FontLocker fontLocker;
@@ -214,9 +218,9 @@
#if OS(WINDOWS) && ENABLE(OPENTYPE_VERTICAL)
// Leading "@" in the font name enables Windows vertical flow flag for the font.
// Because we do vertical flow by ourselves, we don't want to use the Windows feature.
- // IE disregards "@" regardless of the orientation, so we follow the behavior.
- const AtomicString& familyName = passedFamilyName[0] != '@'
- ? passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
+ // IE disregards "@" regardless of the orientatoin, so we follow the behavior.
+ const AtomicString& familyName = (passedFamilyName.isEmpty() || passedFamilyName[0] != '@') ?
+ passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
#else
const AtomicString& familyName = passedFamilyName;
#endif
@@ -233,13 +237,14 @@
FontPlatformDataCache::iterator it = addResult.iterator;
if (addResult.isNewEntry) {
it->value = createFontPlatformData(fontDescription, familyName);
+
if (!it->value && !checkingAlternateName) {
- // We were unable to find a font. We have a small set of fonts that we alias to other names,
- // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
- auto alternateName = alternateFamilyName(familyName);
+ // We were unable to find a font. We have a small set of fonts that we alias to other names,
+ // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
+ const AtomicString alternateName = alternateFamilyName(familyName);
if (!alternateName.isNull()) {
FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, true);
- // Look up the key in the hash table again as the previous iterator may have
+ // Lookup the key in the hash table again as the previous iterator may have
// been invalidated by the recursive call to getCachedFontPlatformData().
it = fontPlatformDataCache().find(key);
ASSERT(it != fontPlatformDataCache().end());
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (195916 => 195917)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -190,20 +190,22 @@
Ref<FontCascadeFonts> fonts;
};
-// FIXME: Should make hash traits for FontCascadeCacheKey instead of using a hash as the key (so we hash a hash).
typedef HashMap<unsigned, std::unique_ptr<FontCascadeCacheEntry>, AlreadyHashed> FontCascadeCache;
-static bool keysMatch(const FontCascadeCacheKey& a, const FontCascadeCacheKey& b)
+static bool operator==(const FontCascadeCacheKey& a, const FontCascadeCacheKey& b)
{
if (a.fontDescriptionKey != b.fontDescriptionKey)
return false;
if (a.fontSelectorId != b.fontSelectorId || a.fontSelectorVersion != b.fontSelectorVersion)
return false;
- unsigned size = a.families.size();
- if (size != b.families.size())
+ if (a.families.size() != b.families.size())
return false;
- for (unsigned i = 0; i < size; ++i) {
- if (!equalIgnoringASCIICase(a.families[i], b.families[i]))
+ for (unsigned i = 0; i < a.families.size(); ++i) {
+ auto* aImpl = a.families[i].impl();
+ auto* bImpl = b.families[i].impl();
+ if (aImpl == bImpl)
+ continue;
+ if (!aImpl || !bImpl || !CaseFoldingHash::equal(aImpl, bImpl))
return false;
}
return true;
@@ -230,27 +232,26 @@
{
FontCascadeCacheKey key;
key.fontDescriptionKey = FontDescriptionKey(description);
- unsigned familyCount = description.familyCount();
- key.families.reserveInitialCapacity(familyCount);
- for (unsigned i = 0; i < familyCount; ++i)
- key.families.uncheckedAppend(description.familyAt(i));
+ for (unsigned i = 0; i < description.familyCount(); ++i)
+ key.families.append(description.familyAt(i));
key.fontSelectorId = fontSelector ? fontSelector->uniqueId() : 0;
key.fontSelectorVersion = fontSelector ? fontSelector->version() : 0;
return key;
}
+// FIXME: Why can't we just teach HashMap about FontCascadeCacheKey instead of hashing a hash?
static unsigned computeFontCascadeCacheHash(const FontCascadeCacheKey& key)
{
- // FIXME: Should hash the key and the family name characters rather than making a hash out of other hashes.
- IntegerHasher hasher;
- hasher.add(key.fontDescriptionKey.computeHash());
- hasher.add(key.fontSelectorId);
- hasher.add(key.fontSelectorVersion);
- for (unsigned i = 0; i < key.families.size(); ++i) {
- StringImpl* family = key.families[i].impl();
- hasher.add(family ? ASCIICaseInsensitiveHash::hash(family) : 0);
- }
- return hasher.hash();
+ Vector<unsigned, 7> hashCodes;
+ hashCodes.reserveInitialCapacity(4 + key.families.size());
+
+ hashCodes.uncheckedAppend(key.fontDescriptionKey.computeHash());
+ hashCodes.uncheckedAppend(key.fontSelectorId);
+ hashCodes.uncheckedAppend(key.fontSelectorVersion);
+ for (unsigned i = 0; i < key.families.size(); ++i)
+ hashCodes.uncheckedAppend(key.families[i].impl() ? CaseFoldingHash::hash(key.families[i]) : 0);
+
+ return StringHasher::hashMemory(hashCodes.data(), hashCodes.size() * sizeof(unsigned));
}
void pruneUnreferencedEntriesFromFontCascadeCache()
@@ -271,8 +272,8 @@
auto key = makeFontCascadeCacheKey(fontDescription, fontSelector.get());
unsigned hash = computeFontCascadeCacheHash(key);
- auto addResult = fontCascadeCache().add(hash, nullptr);
- if (!addResult.isNewEntry && keysMatch(addResult.iterator->value->key, key))
+ auto addResult = fontCascadeCache().add(hash, std::unique_ptr<FontCascadeCacheEntry>());
+ if (!addResult.isNewEntry && addResult.iterator->value->key == key)
return addResult.iterator->value->fonts.get();
auto& newEntry = addResult.iterator->value;
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (195916 => 195917)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -645,7 +645,7 @@
return SynthesisPair(needsSyntheticBold, needsSyntheticOblique);
}
-typedef HashSet<String, ASCIICaseInsensitiveHash> Whitelist;
+typedef HashSet<String, CaseFoldingHash> Whitelist;
static Whitelist& fontWhitelist()
{
static NeverDestroyed<Whitelist> whitelist;
Modified: trunk/Source/WebCore/platform/network/HTTPHeaderMap.h (195916 => 195917)
--- trunk/Source/WebCore/platform/network/HTTPHeaderMap.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/platform/network/HTTPHeaderMap.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -48,7 +48,7 @@
class HTTPHeaderMap {
public:
typedef HashMap<HTTPHeaderName, String, WTF::IntHash<HTTPHeaderName>, WTF::StrongEnumHashTraits<HTTPHeaderName>> CommonHeadersHashMap;
- typedef HashMap<String, String, ASCIICaseInsensitiveHash> UncommonHeadersHashMap;
+ typedef HashMap<String, String, CaseFoldingHash> UncommonHeadersHashMap;
class HTTPHeaderMapConstIterator {
public:
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (195916 => 195917)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -366,19 +366,21 @@
}
#if ENABLE(IOS_TEXT_AUTOSIZING)
-
-static inline unsigned computeFontHash(const FontCascade& font)
+inline unsigned computeFontHash(const FontCascade& font)
{
- IntegerHasher hasher;
- hasher.add(ASCIICaseInsensitiveHash::hash(font.fontDescription().firstFamily()));
- hasher.add(font.fontDescription().specifiedSize());
- return hasher.hash();
+ unsigned hashCodes[2] = {
+ CaseFoldingHash::hash(font.fontDescription().firstFamily().impl()),
+ static_cast<unsigned>(font.fontDescription().specifiedSize())
+ };
+ return StringHasher::computeHash(reinterpret_cast<UChar*>(hashCodes), 2 * sizeof(unsigned) / sizeof(UChar));
}
-unsigned RenderStyle::hashForTextAutosizing() const
+uint32_t RenderStyle::hashForTextAutosizing() const
{
// FIXME: Not a very smart hash. Could be improved upon. See <https://bugs.webkit.org/show_bug.cgi?id=121131>.
- unsigned hash = rareNonInheritedData->m_appearance;
+ uint32_t hash = 0;
+
+ hash ^= rareNonInheritedData->m_appearance;
hash ^= rareNonInheritedData->marginBeforeCollapse;
hash ^= rareNonInheritedData->marginAfterCollapse;
hash ^= rareNonInheritedData->lineClamp.value();
@@ -419,7 +421,6 @@
&& noninherited_flags.floating() == other->noninherited_flags.floating()
&& rareNonInheritedData->textOverflow == other->rareNonInheritedData->textOverflow;
}
-
#endif // ENABLE(IOS_TEXT_AUTOSIZING)
bool RenderStyle::inheritedDataShared(const RenderStyle* other) const
Modified: trunk/Source/WebKit/win/ChangeLog (195916 => 195917)
--- trunk/Source/WebKit/win/ChangeLog 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit/win/ChangeLog 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,5 +1,19 @@
2016-01-30 Commit Queue <[email protected]>
+ Unreviewed, rolling out r195911.
+ https://bugs.webkit.org/show_bug.cgi?id=153723
+
+ Caused frequent assertion failures on bots (Requested by ap on
+ #webkit).
+
+ Reverted changeset:
+
+ "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+ https://bugs.webkit.org/show_bug.cgi?id=153639
+ http://trac.webkit.org/changeset/195911
+
+2016-01-30 Commit Queue <[email protected]>
+
Unreviewed, rolling out r195799 and r195828.
https://bugs.webkit.org/show_bug.cgi?id=153722
Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (195916 => 195917)
--- trunk/Source/WebKit/win/WebCoreStatistics.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit/win/WebCoreStatistics.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -295,7 +295,7 @@
unsigned long long heapFree = JSDOMWindow::commonVM().heap.capacity() - heapSize;
GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
- HashMap<String, unsigned long long, ASCIICaseInsensitiveHash> fields;
+ HashMap<String, unsigned long long, CaseFoldingHash> fields;
fields.add("FastMallocReservedVMBytes", static_cast<unsigned long long>(fastMallocStatistics.reservedVMBytes));
fields.add("FastMallocCommittedVMBytes", static_cast<unsigned long long>(fastMallocStatistics.committedVMBytes));
fields.add("FastMallocFreeListBytes", static_cast<unsigned long long>(fastMallocStatistics.freeListBytes));
@@ -304,7 +304,7 @@
fields.add("_javascript_StackSize", static_cast<unsigned long long>(globalMemoryStats.stackBytes));
fields.add("_javascript_JITSize", static_cast<unsigned long long>(globalMemoryStats.JITBytes));
- *statistics = COMPropertyBag<unsigned long long, String, ASCIICaseInsensitiveHash>::adopt(fields);
+ *statistics = COMPropertyBag<unsigned long long, String, CaseFoldingHash>::adopt(fields);
return S_OK;
}
Modified: trunk/Source/WebKit/win/WebURLResponse.cpp (195916 => 195917)
--- trunk/Source/WebKit/win/WebURLResponse.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit/win/WebURLResponse.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -362,11 +362,11 @@
if (!headerFields)
return E_POINTER;
- HashMap<String, String, ASCIICaseInsensitiveHash> fields;
+ HashMap<String, String, CaseFoldingHash> fields;
for (const auto& keyValuePair : m_response.httpHeaderFields())
fields.add(keyValuePair.key, keyValuePair.value);
- *headerFields = COMPropertyBag<String, String, ASCIICaseInsensitiveHash>::adopt(fields);
+ *headerFields = COMPropertyBag<String, String, CaseFoldingHash>::adopt(fields);
return S_OK;
}
Modified: trunk/Source/WebKit2/ChangeLog (195916 => 195917)
--- trunk/Source/WebKit2/ChangeLog 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit2/ChangeLog 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,3 +1,17 @@
+2016-01-30 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r195911.
+ https://bugs.webkit.org/show_bug.cgi?id=153723
+
+ Caused frequent assertion failures on bots (Requested by ap on
+ #webkit).
+
+ Reverted changeset:
+
+ "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+ https://bugs.webkit.org/show_bug.cgi?id=153639
+ http://trac.webkit.org/changeset/195911
+
2016-01-30 Dan Bernstein <[email protected]>
[Cocoa] Get rid of WK_ macros for nullability
Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm (195916 => 195917)
--- trunk/Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm 2016-01-31 00:53:20 UTC (rev 195917)
@@ -42,7 +42,7 @@
using namespace WebKit;
@implementation WKWebViewContentProviderRegistry {
- HashMap<String, Class <WKWebViewContentProvider>, ASCIICaseInsensitiveHash> _contentProviderForMIMEType;
+ HashMap<String, Class <WKWebViewContentProvider>, CaseFoldingHash> _contentProviderForMIMEType;
HashCountedSet<WebPageProxy*> _pages;
}
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h (195916 => 195917)
--- trunk/Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -69,7 +69,7 @@
void setAutoStartOriginsTableWithItemsPassingTest(API::Dictionary&, std::function<bool(double expirationTimestamp)>);
- typedef HashMap<String, PlugInAutoStartOriginMap, ASCIICaseInsensitiveHash> AutoStartTable;
+ typedef HashMap<String, PlugInAutoStartOriginMap, CaseFoldingHash> AutoStartTable;
typedef HashMap<WebCore::SessionID, AutoStartTable> SessionAutoStartTable;
SessionAutoStartTable m_autoStartTable;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (195916 => 195917)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1393,7 +1393,7 @@
WebCore::Timer m_volatilityTimer;
#endif
- HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
+ HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
WebCore::Color m_backgroundColor;
HashSet<unsigned> m_activeRenderingSuppressionTokens;
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (195916 => 195917)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2016-01-31 00:53:20 UTC (rev 195917)
@@ -721,16 +721,16 @@
if (string.isEmpty())
return;
if (string.is8Bit()) {
- hasher.addCharacters<LChar, ASCIICaseInsensitiveHash::foldCase<LChar>>(string.characters8(), string.length());
+ hasher.addCharacters<LChar, CaseFoldingHash::foldCase<LChar>>(string.characters8(), string.length());
return;
}
- hasher.addCharacters<UChar, ASCIICaseInsensitiveHash::foldCase<UChar>>(string.characters16(), string.length());
+ hasher.addCharacters<UChar, CaseFoldingHash::foldCase<UChar>>(string.characters16(), string.length());
}
static unsigned hashForPlugInOrigin(const String& pageOrigin, const String& pluginOrigin, const String& mimeType)
{
// We want to avoid concatenating the strings and then taking the hash, since that could lead to an expensive conversion.
- // We also want to avoid using the hash() function in StringImpl or ASCIICaseInsensitiveHash because that masks out bits for the use of flags.
+ // We also want to avoid using the hash() function in StringImpl or CaseFoldingHash because that masks out bits for the use of flags.
StringHasher hasher;
addCaseFoldedCharacters(hasher, pageOrigin);
hasher.addCharacter(0);
Modified: trunk/Tools/ChangeLog (195916 => 195917)
--- trunk/Tools/ChangeLog 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Tools/ChangeLog 2016-01-31 00:53:20 UTC (rev 195917)
@@ -1,3 +1,17 @@
+2016-01-30 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r195911.
+ https://bugs.webkit.org/show_bug.cgi?id=153723
+
+ Caused frequent assertion failures on bots (Requested by ap on
+ #webkit).
+
+ Reverted changeset:
+
+ "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+ https://bugs.webkit.org/show_bug.cgi?id=153639
+ http://trac.webkit.org/changeset/195911
+
2016-01-30 Darin Adler <[email protected]>
Replace CaseFoldingHash with ASCIICaseInsensitiveHash
Modified: trunk/Tools/Scripts/do-webcore-rename (195916 => 195917)
--- trunk/Tools/Scripts/do-webcore-rename 2016-01-31 00:41:57 UTC (rev 195916)
+++ trunk/Tools/Scripts/do-webcore-rename 2016-01-31 00:53:20 UTC (rev 195917)
@@ -98,7 +98,7 @@
my $isDOMTypeRename = 0;
my %renames = (
# Renames go here in the form of:
- "CaseFoldingHash" => "ASCIICaseInsensitiveHash",
+ "deleteAllValues" => "deprecatedDeleteAllValues",
);
my %renamesContemplatedForTheFuture = (
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
