Diff
Modified: trunk/Source/WebCore/ChangeLog (262921 => 262922)
--- trunk/Source/WebCore/ChangeLog 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/ChangeLog 2020-06-11 20:47:21 UTC (rev 262922)
@@ -1,3 +1,97 @@
+2020-06-11 Beth Dakin <[email protected]>
+
+ Replace instances of whitelist in WebCore with allowlist
+ https://bugs.webkit.org/show_bug.cgi?id=213068
+
+ Reviewed by Tim Horton.
+
+ * Modules/webdatabase/DatabaseAuthorizer.cpp:
+ (WebCore::DatabaseAuthorizer::DatabaseAuthorizer):
+ (WebCore::DatabaseAuthorizer::addAllowedFunctions):
+ (WebCore::DatabaseAuthorizer::allowFunction):
+ (WebCore::DatabaseAuthorizer::addWhitelistedFunctions): Deleted.
+ * Modules/webdatabase/DatabaseAuthorizer.h:
+ * dom/ExtensionStyleSheets.cpp:
+ (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
+ * loader/CrossOriginAccessControl.cpp:
+ (WebCore::isOnAccessControlSimpleRequestMethodAllowlist):
+ (WebCore::isSimpleCrossOriginAccessRequest):
+ (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Deleted.
+ * loader/CrossOriginAccessControl.h:
+ * loader/CrossOriginPreflightResultCache.cpp:
+ (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
+ * loader/appcache/ApplicationCache.cpp:
+ (WebCore::ApplicationCache::setOnlineAllowlist):
+ (WebCore::ApplicationCache::isURLInOnlineAllowlist):
+ (WebCore::ApplicationCache::setOnlineWhitelist): Deleted.
+ (WebCore::ApplicationCache::isURLInOnlineWhitelist): Deleted.
+ * loader/appcache/ApplicationCache.h:
+ (WebCore::ApplicationCache::onlineAllowlist const):
+ (WebCore::ApplicationCache::onlineWhitelist const): Deleted.
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
+ * loader/appcache/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
+ (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
+ * loader/appcache/ApplicationCacheStorage.cpp:
+ (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
+ (WebCore::ApplicationCacheStorage::openDatabase):
+ (WebCore::ApplicationCacheStorage::store):
+ (WebCore::ApplicationCacheStorage::loadCache):
+ * loader/appcache/ManifestParser.cpp:
+ (WebCore::parseManifest):
+ * loader/appcache/ManifestParser.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::injectUserScriptImmediately):
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::canRequest const):
+ (WebCore::SecurityOrigin::canDisplay const):
+ * page/SecurityPolicy.cpp:
+ (WebCore::SecurityPolicy::isAccessAllowed):
+ (WebCore::SecurityPolicy::addOriginAccessAllowlistEntry):
+ (WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry):
+ (WebCore::SecurityPolicy::resetOriginAccessAllowlists):
+ (WebCore::SecurityPolicy::isAccessWhiteListed): Deleted.
+ (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): Deleted.
+ (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): Deleted.
+ (WebCore::SecurityPolicy::resetOriginAccessWhitelists): Deleted.
+ * page/SecurityPolicy.h:
+ * page/UserContentURLPattern.cpp:
+ (WebCore::UserContentURLPattern::matchesPatterns):
+ * page/UserContentURLPattern.h:
+ * page/UserScript.h:
+ (WebCore::UserScript::UserScript):
+ (WebCore::UserScript::allowlist const):
+ (WebCore::UserScript::encode const):
+ (WebCore::UserScript::decode):
+ (WebCore::UserScript::whitelist const): Deleted.
+ * page/UserStyleSheet.h:
+ (WebCore::UserStyleSheet::UserStyleSheet):
+ (WebCore::UserStyleSheet::allowlist const):
+ (WebCore::UserStyleSheet::whitelist const): Deleted.
+ * platform/graphics/FontCache.h:
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::fontAllowlist):
+ (WebCore::FontCache::setFontAllowlist):
+ (WebCore::platformFontLookupWithFamily):
+ (WebCore::fontWhitelist): Deleted.
+ (WebCore::FontCache::setFontWhitelist): Deleted.
+ * platform/network/HTTPParsers.cpp:
+ (WebCore::isValidAcceptHeaderValue):
+ * rendering/FloatingObjects.h:
+ * style/ElementRuleCollector.cpp:
+ (WebCore::Style::ElementRuleCollector::transferMatchedRules):
+ * style/ElementRuleCollector.h:
+ * style/PropertyCascade.cpp:
+ (WebCore::Style::PropertyCascade::addMatch):
+ * style/RuleData.cpp:
+ (WebCore::Style::determinePropertyAllowlistType):
+ (WebCore::Style::RuleData::RuleData):
+ (WebCore::Style::determinePropertyWhitelistType): Deleted.
+ * style/RuleData.h:
+ (WebCore::Style::RuleData::propertyAllowlistType const):
+ (WebCore::Style::RuleData::propertyWhitelistType const): Deleted.
+
2020-06-11 Andy Estes <[email protected]>
[iOS] nullptr deref in FileInputType::iconLoaded when the input's type attribute is modified by a change event listener
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp (262921 => 262922)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -43,7 +43,7 @@
, m_databaseInfoTableName(databaseInfoTableName)
{
reset();
- addWhitelistedFunctions();
+ addAllowedFunctions();
}
void DatabaseAuthorizer::reset()
@@ -58,68 +58,68 @@
m_hadDeletes = false;
}
-void DatabaseAuthorizer::addWhitelistedFunctions()
+void DatabaseAuthorizer::addAllowedFunctions()
{
// SQLite functions used to help implement some operations
// ALTER TABLE helpers
- m_whitelistedFunctions.add("sqlite_rename_table");
- m_whitelistedFunctions.add("sqlite_rename_trigger");
+ m_allowedFunctions.add("sqlite_rename_table");
+ m_allowedFunctions.add("sqlite_rename_trigger");
// GLOB helpers
- m_whitelistedFunctions.add("glob");
+ m_allowedFunctions.add("glob");
// SQLite core functions
- m_whitelistedFunctions.add("abs");
- m_whitelistedFunctions.add("changes");
- m_whitelistedFunctions.add("coalesce");
- m_whitelistedFunctions.add("glob");
- m_whitelistedFunctions.add("ifnull");
- m_whitelistedFunctions.add("hex");
- m_whitelistedFunctions.add("last_insert_rowid");
- m_whitelistedFunctions.add("length");
- m_whitelistedFunctions.add("like");
- m_whitelistedFunctions.add("lower");
- m_whitelistedFunctions.add("ltrim");
- m_whitelistedFunctions.add("max");
- m_whitelistedFunctions.add("min");
- m_whitelistedFunctions.add("nullif");
- m_whitelistedFunctions.add("quote");
- m_whitelistedFunctions.add("replace");
- m_whitelistedFunctions.add("round");
- m_whitelistedFunctions.add("rtrim");
- m_whitelistedFunctions.add("soundex");
- m_whitelistedFunctions.add("sqlite_source_id");
- m_whitelistedFunctions.add("sqlite_version");
- m_whitelistedFunctions.add("substr");
- m_whitelistedFunctions.add("total_changes");
- m_whitelistedFunctions.add("trim");
- m_whitelistedFunctions.add("typeof");
- m_whitelistedFunctions.add("upper");
- m_whitelistedFunctions.add("zeroblob");
+ m_allowedFunctions.add("abs");
+ m_allowedFunctions.add("changes");
+ m_allowedFunctions.add("coalesce");
+ m_allowedFunctions.add("glob");
+ m_allowedFunctions.add("ifnull");
+ m_allowedFunctions.add("hex");
+ m_allowedFunctions.add("last_insert_rowid");
+ m_allowedFunctions.add("length");
+ m_allowedFunctions.add("like");
+ m_allowedFunctions.add("lower");
+ m_allowedFunctions.add("ltrim");
+ m_allowedFunctions.add("max");
+ m_allowedFunctions.add("min");
+ m_allowedFunctions.add("nullif");
+ m_allowedFunctions.add("quote");
+ m_allowedFunctions.add("replace");
+ m_allowedFunctions.add("round");
+ m_allowedFunctions.add("rtrim");
+ m_allowedFunctions.add("soundex");
+ m_allowedFunctions.add("sqlite_source_id");
+ m_allowedFunctions.add("sqlite_version");
+ m_allowedFunctions.add("substr");
+ m_allowedFunctions.add("total_changes");
+ m_allowedFunctions.add("trim");
+ m_allowedFunctions.add("typeof");
+ m_allowedFunctions.add("upper");
+ m_allowedFunctions.add("zeroblob");
// SQLite date and time functions
- m_whitelistedFunctions.add("date");
- m_whitelistedFunctions.add("time");
- m_whitelistedFunctions.add("datetime");
- m_whitelistedFunctions.add("julianday");
- m_whitelistedFunctions.add("strftime");
+ m_allowedFunctions.add("date");
+ m_allowedFunctions.add("time");
+ m_allowedFunctions.add("datetime");
+ m_allowedFunctions.add("julianday");
+ m_allowedFunctions.add("strftime");
// SQLite aggregate functions
// max() and min() are already in the list
- m_whitelistedFunctions.add("avg");
- m_whitelistedFunctions.add("count");
- m_whitelistedFunctions.add("group_concat");
- m_whitelistedFunctions.add("sum");
- m_whitelistedFunctions.add("total");
+ m_allowedFunctions.add("avg");
+ m_allowedFunctions.add("count");
+ m_allowedFunctions.add("group_concat");
+ m_allowedFunctions.add("sum");
+ m_allowedFunctions.add("total");
// SQLite FTS functions
- m_whitelistedFunctions.add("match");
- m_whitelistedFunctions.add("snippet");
- m_whitelistedFunctions.add("offsets");
- m_whitelistedFunctions.add("optimize");
+ m_allowedFunctions.add("match");
+ m_allowedFunctions.add("snippet");
+ m_allowedFunctions.add("offsets");
+ m_allowedFunctions.add("optimize");
// SQLite ICU functions
// like(), lower() and upper() are already in the list
- m_whitelistedFunctions.add("regexp");
+ m_allowedFunctions.add("regexp");
}
int DatabaseAuthorizer::createTable(const String& tableName)
@@ -359,7 +359,7 @@
int DatabaseAuthorizer::allowFunction(const String& functionName)
{
- if (m_securityEnabled && !m_whitelistedFunctions.contains(functionName))
+ if (m_securityEnabled && !m_allowedFunctions.contains(functionName))
return SQLAuthDeny;
return SQLAuthAllow;
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h (262921 => 262922)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -104,7 +104,7 @@
private:
explicit DatabaseAuthorizer(const String& databaseInfoTableName);
- void addWhitelistedFunctions();
+ void addAllowedFunctions();
int denyBasedOnTableName(const String&) const;
int updateDeletesBasedOnTableName(const String&);
bool allowWrite();
@@ -117,7 +117,7 @@
const String m_databaseInfoTableName;
- HashSet<String, ASCIICaseInsensitiveHash> m_whitelistedFunctions;
+ HashSet<String, ASCIICaseInsensitiveHash> m_allowedFunctions;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp (262921 => 262922)
--- trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -148,7 +148,7 @@
if (userStyleSheet.injectedFrames() == UserContentInjectedFrames::InjectInTopFrameOnly && m_document.ownerElement())
return;
- if (!UserContentURLPattern::matchesPatterns(m_document.url(), userStyleSheet.whitelist(), userStyleSheet.blocklist()))
+ if (!UserContentURLPattern::matchesPatterns(m_document.url(), userStyleSheet.allowlist(), userStyleSheet.blocklist()))
return;
addStyleSheet(userStyleSheet);
Modified: trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -45,7 +45,7 @@
namespace WebCore {
-bool isOnAccessControlSimpleRequestMethodWhitelist(const String& method)
+bool isOnAccessControlSimpleRequestMethodAllowlist(const String& method)
{
return method == "GET" || method == "HEAD" || method == "POST";
}
@@ -52,7 +52,7 @@
bool isSimpleCrossOriginAccessRequest(const String& method, const HTTPHeaderMap& headerMap)
{
- if (!isOnAccessControlSimpleRequestMethodWhitelist(method))
+ if (!isOnAccessControlSimpleRequestMethodAllowlist(method))
return false;
for (const auto& header : headerMap) {
Modified: trunk/Source/WebCore/loader/CrossOriginAccessControl.h (262921 => 262922)
--- trunk/Source/WebCore/loader/CrossOriginAccessControl.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/CrossOriginAccessControl.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -46,7 +46,7 @@
struct ResourceLoaderOptions;
WEBCORE_EXPORT bool isSimpleCrossOriginAccessRequest(const String& method, const HTTPHeaderMap&);
-bool isOnAccessControlSimpleRequestMethodWhitelist(const String&);
+bool isOnAccessControlSimpleRequestMethodAllowlist(const String&);
void updateRequestReferrer(ResourceRequest&, ReferrerPolicy, const String&);
Modified: trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -84,7 +84,7 @@
bool CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod(const String& method, StoredCredentialsPolicy storedCredentialsPolicy) const
{
- return m_methods.contains(method) || (m_methods.contains("*") && storedCredentialsPolicy != StoredCredentialsPolicy::Use) || isOnAccessControlSimpleRequestMethodWhitelist(method);
+ return m_methods.contains(method) || (m_methods.contains("*") && storedCredentialsPolicy != StoredCredentialsPolicy::Use) || isOnAccessControlSimpleRequestMethodAllowlist(method);
}
Optional<String> CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders(const HTTPHeaderMap& requestHeaders, StoredCredentialsPolicy storedCredentialsPolicy) const
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCache.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ApplicationCache.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCache.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -124,16 +124,16 @@
return resourceForURL(url.string());
}
-void ApplicationCache::setOnlineWhitelist(const Vector<URL>& onlineWhitelist)
+void ApplicationCache::setOnlineAllowlist(const Vector<URL>& onlineAllowlist)
{
- ASSERT(m_onlineWhitelist.isEmpty());
- m_onlineWhitelist = onlineWhitelist;
+ ASSERT(m_onlineAllowlist.isEmpty());
+ m_onlineAllowlist = onlineAllowlist;
}
-bool ApplicationCache::isURLInOnlineWhitelist(const URL& url)
+bool ApplicationCache::isURLInOnlineAllowlist(const URL& url)
{
- for (auto& whitelistURL : m_onlineWhitelist) {
- if (protocolHostAndPortAreEqual(url, whitelistURL) && url.string().startsWith(whitelistURL.string()))
+ for (auto& allowlistURL : m_onlineAllowlist) {
+ if (protocolHostAndPortAreEqual(url, allowlistURL) && url.string().startsWith(allowlistURL.string()))
return true;
}
return false;
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCache.h (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ApplicationCache.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCache.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -58,9 +58,9 @@
void setAllowsAllNetworkRequests(bool value) { m_allowAllNetworkRequests = value; }
bool allowsAllNetworkRequests() const { return m_allowAllNetworkRequests; }
- void setOnlineWhitelist(const Vector<URL>& onlineWhitelist);
- const Vector<URL>& onlineWhitelist() const { return m_onlineWhitelist; }
- bool isURLInOnlineWhitelist(const URL&); // There is an entry in online whitelist that has the same origin as the resource's URL and that is a prefix match for the resource's URL.
+ void setOnlineAllowlist(const Vector<URL>&);
+ const Vector<URL>& onlineAllowlist() const { return m_onlineAllowlist; }
+ bool isURLInOnlineAllowlist(const URL&); // There is an entry in online allowlist that has the same origin as the resource's URL and that is a prefix match for the resource's URL.
void setFallbackURLs(const FallbackURLVector&);
const FallbackURLVector& fallbackURLs() const { return m_fallbackURLs; }
@@ -89,7 +89,7 @@
WeakPtr<ApplicationCacheResource> m_manifest;
bool m_allowAllNetworkRequests { false };
- Vector<URL> m_onlineWhitelist;
+ Vector<URL> m_onlineAllowlist;
FallbackURLVector m_fallbackURLs;
// The total size of the resources belonging to this Application Cache instance.
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -641,7 +641,7 @@
for (auto& fallbackURL : manifest.fallbackURLs)
addEntry(fallbackURL.second.string(), ApplicationCacheResource::Fallback);
- m_cacheBeingUpdated->setOnlineWhitelist(manifest.onlineWhitelistedURLs);
+ m_cacheBeingUpdated->setOnlineAllowlist(manifest.onlineAllowedURLs);
m_cacheBeingUpdated->setFallbackURLs(manifest.fallbackURLs);
m_cacheBeingUpdated->setAllowsAllNetworkRequests(manifest.allowAllNetworkRequests);
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -430,9 +430,9 @@
// in the application cache, then get the resource from the cache (instead of fetching it).
resource = cache->resourceForURL(request.url().string());
- // Resources that match fallback namespaces or online whitelist entries are fetched from the network,
+ // Resources that match fallback namespaces or online allowlist entries are fetched from the network,
// unless they are also cached.
- if (!resource && (cache->allowsAllNetworkRequests() || cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineWhitelist(request.url())))
+ if (!resource && (cache->allowsAllNetworkRequests() || cache->urlMatchesFallbackNamespace(request.url()) || cache->isURLInOnlineAllowlist(request.url())))
return false;
// Resources that are not present in the manifest will always fail to load (at least, after the
@@ -455,7 +455,7 @@
return false;
URL fallbackURL;
- if (cache->isURLInOnlineWhitelist(request.url()))
+ if (cache->isURLInOnlineAllowlist(request.url()))
return false;
if (!cache->urlMatchesFallbackNamespace(request.url(), &fallbackURL))
return false;
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -265,7 +265,7 @@
if (ApplicationCache* cache = group->newestCache()) {
URL fallbackURL;
- if (cache->isURLInOnlineWhitelist(url))
+ if (cache->isURLInOnlineAllowlist(url))
continue;
if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
continue;
@@ -300,7 +300,7 @@
auto cache = loadCache(newestCacheID);
URL fallbackURL;
- if (cache->isURLInOnlineWhitelist(url))
+ if (cache->isURLInOnlineAllowlist(url))
continue;
if (!cache->urlMatchesFallbackNamespace(url, &fallbackURL))
continue;
@@ -616,7 +616,7 @@
executeSQLCommand("CREATE TABLE IF NOT EXISTS DeletedCacheResources (id INTEGER PRIMARY KEY AUTOINCREMENT, path TEXT)");
executeSQLCommand("CREATE TABLE IF NOT EXISTS Origins (origin TEXT UNIQUE ON CONFLICT IGNORE, quota INTEGER NOT NULL ON CONFLICT FAIL)");
- // When a cache is deleted, all its entries and its whitelist should be deleted.
+ // When a cache is deleted, all its entries and its allowlist should be deleted.
executeSQLCommand("CREATE TRIGGER IF NOT EXISTS CacheDeleted AFTER DELETE ON Caches"
" FOR EACH ROW BEGIN"
" DELETE FROM CacheEntries WHERE cache = OLD.id;"
@@ -721,14 +721,14 @@
storageIDJournal->add(resource.get(), oldStorageID);
}
- // Store the online whitelist
- const Vector<URL>& _onlineWhitelist_ = cache->onlineWhitelist();
+ // Store the online allowlist
+ const Vector<URL>& _onlineAllowlist_ = cache->onlineAllowlist();
{
- for (auto& whitelistURL : onlineWhitelist) {
+ for (auto& allowlistURL : onlineAllowlist) {
SQLiteStatement statement(m_database, "INSERT INTO CacheWhitelistURLs (url, cache) VALUES (?, ?)");
statement.prepare();
- statement.bindText(1, whitelistURL.string());
+ statement.bindText(1, allowlistURL.string());
statement.bindInt64(2, cacheStorageID);
if (!executeStatement(statement))
@@ -736,7 +736,7 @@
}
}
- // Store online whitelist wildcard flag.
+ // Store online allowlist wildcard flag.
{
SQLiteStatement statement(m_database, "INSERT INTO CacheAllowsAllNetworkRequests (wildcard, cache) VALUES (?, ?)");
statement.prepare();
@@ -1154,35 +1154,35 @@
return nullptr;
}
- // Load the online whitelist
- SQLiteStatement whitelistStatement(m_database, "SELECT url FROM CacheWhitelistURLs WHERE cache=?");
- if (whitelistStatement.prepare() != SQLITE_OK)
+ // Load the online allowlist
+ SQLiteStatement allowlistStatement(m_database, "SELECT url FROM CacheWhitelistURLs WHERE cache=?");
+ if (allowlistStatement.prepare() != SQLITE_OK)
return nullptr;
- whitelistStatement.bindInt64(1, storageID);
+ allowlistStatement.bindInt64(1, storageID);
- Vector<URL> whitelist;
- while ((result = whitelistStatement.step()) == SQLITE_ROW)
- whitelist.append(URL({ }, whitelistStatement.getColumnText(0)));
+ Vector<URL> allowlist;
+ while ((result = allowlistStatement.step()) == SQLITE_ROW)
+ allowlist.append(URL({ }, allowlistStatement.getColumnText(0)));
if (result != SQLITE_DONE)
- LOG_ERROR("Could not load cache online whitelist, error \"%s\"", m_database.lastErrorMsg());
+ LOG_ERROR("Could not load cache online allowlist, error \"%s\"", m_database.lastErrorMsg());
- cache->setOnlineWhitelist(whitelist);
+ cache->setOnlineAllowlist(allowlist);
- // Load online whitelist wildcard flag.
- SQLiteStatement whitelistWildcardStatement(m_database, "SELECT wildcard FROM CacheAllowsAllNetworkRequests WHERE cache=?");
- if (whitelistWildcardStatement.prepare() != SQLITE_OK)
+ // Load online allowlist wildcard flag.
+ SQLiteStatement allowlistWildcardStatement(m_database, "SELECT wildcard FROM CacheAllowsAllNetworkRequests WHERE cache=?");
+ if (allowlistWildcardStatement.prepare() != SQLITE_OK)
return nullptr;
- whitelistWildcardStatement.bindInt64(1, storageID);
+ allowlistWildcardStatement.bindInt64(1, storageID);
- result = whitelistWildcardStatement.step();
+ result = allowlistWildcardStatement.step();
if (result != SQLITE_ROW)
- LOG_ERROR("Could not load cache online whitelist wildcard flag, error \"%s\"", m_database.lastErrorMsg());
+ LOG_ERROR("Could not load cache online allowlist wildcard flag, error \"%s\"", m_database.lastErrorMsg());
- cache->setAllowsAllNetworkRequests(whitelistWildcardStatement.getColumnInt64(0));
+ cache->setAllowsAllNetworkRequests(allowlistWildcardStatement.getColumnInt64(0));
- if (whitelistWildcardStatement.step() != SQLITE_DONE)
- LOG_ERROR("Too many rows for online whitelist wildcard flag");
+ if (allowlistWildcardStatement.step() != SQLITE_DONE)
+ LOG_ERROR("Too many rows for online allowlist wildcard flag");
// Load fallback URLs.
SQLiteStatement fallbackStatement(m_database, "SELECT namespace, fallbackURL FROM FallbackURLs WHERE cache=?");
Modified: trunk/Source/WebCore/loader/appcache/ManifestParser.cpp (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ManifestParser.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ManifestParser.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -33,7 +33,7 @@
namespace WebCore {
-enum Mode { Explicit, Fallback, OnlineWhitelist, Unknown };
+enum Mode { Explicit, Fallback, OnlineAllowlist, Unknown };
static StringView manifestPath(const URL& manifestURL)
{
@@ -47,7 +47,7 @@
bool parseManifest(const URL& manifestURL, const String& manifestMIMEType, const char* data, int length, Manifest& manifest)
{
ASSERT(manifest.explicitURLs.isEmpty());
- ASSERT(manifest.onlineWhitelistedURLs.isEmpty());
+ ASSERT(manifest.onlineAllowedURLs.isEmpty());
ASSERT(manifest.fallbackURLs.isEmpty());
manifest.allowAllNetworkRequests = false;
@@ -109,12 +109,12 @@
else if (line == "FALLBACK:")
mode = Fallback;
else if (line == "NETWORK:")
- mode = OnlineWhitelist;
+ mode = OnlineAllowlist;
else if (line.endsWith(':'))
mode = Unknown;
else if (mode == Unknown)
continue;
- else if (mode == Explicit || mode == OnlineWhitelist) {
+ else if (mode == Explicit || mode == OnlineAllowlist) {
auto upconvertedLineCharacters = StringView(line).upconvertedCharacters();
const UChar* p = upconvertedLineCharacters;
const UChar* lineEnd = p + line.length();
@@ -123,7 +123,7 @@
while (p < lineEnd && *p != '\t' && *p != ' ')
p++;
- if (mode == OnlineWhitelist && p - upconvertedLineCharacters == 1 && line[0] == '*') {
+ if (mode == OnlineAllowlist && p - upconvertedLineCharacters == 1 && line[0] == '*') {
// Wildcard was found.
manifest.allowAllNetworkRequests = true;
continue;
@@ -145,7 +145,7 @@
if (mode == Explicit)
manifest.explicitURLs.add(url.string());
else
- manifest.onlineWhitelistedURLs.append(url);
+ manifest.onlineAllowedURLs.append(url);
} else if (mode == Fallback) {
auto upconvertedLineCharacters = StringView(line).upconvertedCharacters();
Modified: trunk/Source/WebCore/loader/appcache/ManifestParser.h (262921 => 262922)
--- trunk/Source/WebCore/loader/appcache/ManifestParser.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/loader/appcache/ManifestParser.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -31,7 +31,7 @@
namespace WebCore {
struct Manifest {
- Vector<URL> onlineWhitelistedURLs;
+ Vector<URL> onlineAllowedURLs;
HashSet<String> explicitURLs;
FallbackURLVector fallbackURLs;
bool allowAllNetworkRequests; // Wildcard found in NETWORK section.
Modified: trunk/Source/WebCore/page/Frame.cpp (262921 => 262922)
--- trunk/Source/WebCore/page/Frame.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/Frame.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -671,7 +671,7 @@
return;
if (script.injectedFrames() == UserContentInjectedFrames::InjectInTopFrameOnly && !isMainFrame())
return;
- if (!UserContentURLPattern::matchesPatterns(document->url(), script.whitelist(), script.blocklist()))
+ if (!UserContentURLPattern::matchesPatterns(document->url(), script.allowlist(), script.blocklist()))
return;
if (!m_script->shouldAllowUserAgentScripts(*document))
return;
Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (262921 => 262922)
--- trunk/Source/WebCore/page/SecurityOrigin.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -323,7 +323,7 @@
if (isSameSchemeHostPort(targetOrigin.get()))
return true;
- if (SecurityPolicy::isAccessWhiteListed(*this, targetOrigin.get(), url))
+ if (SecurityPolicy::isAccessAllowed(*this, targetOrigin.get(), url))
return true;
return false;
@@ -382,7 +382,7 @@
return canRequest(url);
if (LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated(protocol))
- return equalIgnoringASCIICase(m_data.protocol, protocol) || SecurityPolicy::isAccessWhiteListed(*this, url);
+ return equalIgnoringASCIICase(m_data.protocol, protocol) || SecurityPolicy::isAccessAllowed(*this, url);
if (!SecurityPolicy::restrictAccessToLocal())
return true;
@@ -391,7 +391,7 @@
return true;
if (LegacySchemeRegistry::shouldTreatURLSchemeAsLocal(protocol))
- return canLoadLocalResources() || SecurityPolicy::isAccessWhiteListed(*this, url);
+ return canLoadLocalResources() || SecurityPolicy::isAccessAllowed(*this, url);
return true;
}
Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (262921 => 262922)
--- trunk/Source/WebCore/page/SecurityPolicy.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -43,8 +43,8 @@
static SecurityPolicy::LocalLoadPolicy localLoadPolicy = SecurityPolicy::AllowLocalLoadsForLocalOnly;
-typedef Vector<OriginAccessEntry> OriginAccessWhiteList;
-typedef HashMap<String, std::unique_ptr<OriginAccessWhiteList>> OriginAccessMap;
+typedef Vector<OriginAccessEntry> OriginAccessAllowlist;
+typedef HashMap<String, std::unique_ptr<OriginAccessAllowlist>> OriginAccessMap;
static Lock originAccessMapLock;
static OriginAccessMap& originAccessMap()
@@ -201,12 +201,12 @@
return localLoadPolicy != SecurityPolicy::AllowLocalLoadsForLocalOnly;
}
-bool SecurityPolicy::isAccessWhiteListed(const SecurityOrigin& activeOrigin, const SecurityOrigin& targetOrigin, const URL& targetURL)
+bool SecurityPolicy::isAccessAllowed(const SecurityOrigin& activeOrigin, const SecurityOrigin& targetOrigin, const URL& targetURL)
{
ASSERT(targetOrigin.equal(SecurityOrigin::create(targetURL).ptr()));
{
Locker<Lock> locker(originAccessMapLock);
- if (OriginAccessWhiteList* list = originAccessMap().get(activeOrigin.toString())) {
+ if (OriginAccessAllowlist* list = originAccessMap().get(activeOrigin.toString())) {
for (auto& entry : *list) {
if (entry.matchesOrigin(targetOrigin))
return true;
@@ -221,12 +221,12 @@
return false;
}
-bool SecurityPolicy::isAccessWhiteListed(const SecurityOrigin& activeOrigin, const URL& url)
+bool SecurityPolicy::isAccessAllowed(const SecurityOrigin& activeOrigin, const URL& url)
{
- return isAccessWhiteListed(activeOrigin, SecurityOrigin::create(url).get(), url);
+ return isAccessAllowed(activeOrigin, SecurityOrigin::create(url).get(), url);
}
-void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
+void SecurityPolicy::addOriginAccessAllowlistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
{
ASSERT(!sourceOrigin.isUnique());
if (sourceOrigin.isUnique())
@@ -237,13 +237,13 @@
Locker<Lock> locker(originAccessMapLock);
OriginAccessMap::AddResult result = originAccessMap().add(sourceString, nullptr);
if (result.isNewEntry)
- result.iterator->value = makeUnique<OriginAccessWhiteList>();
+ result.iterator->value = makeUnique<OriginAccessAllowlist>();
- OriginAccessWhiteList* list = result.iterator->value.get();
+ OriginAccessAllowlist* list = result.iterator->value.get();
list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress));
}
-void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
+void SecurityPolicy::removeOriginAccessAllowlistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
{
ASSERT(!sourceOrigin.isUnique());
if (sourceOrigin.isUnique())
@@ -257,7 +257,7 @@
if (it == map.end())
return;
- OriginAccessWhiteList& list = *it->value;
+ OriginAccessAllowlist& list = *it->value;
OriginAccessEntry originAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress);
if (!list.removeFirst(originAccessEntry))
return;
@@ -266,7 +266,7 @@
map.remove(it);
}
-void SecurityPolicy::resetOriginAccessWhitelists()
+void SecurityPolicy::resetOriginAccessAllowlists()
{
Locker<Lock> locker(originAccessMapLock);
originAccessMap().clear();
Modified: trunk/Source/WebCore/page/SecurityPolicy.h (262921 => 262922)
--- trunk/Source/WebCore/page/SecurityPolicy.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/SecurityPolicy.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -68,12 +68,12 @@
static bool allowSubstituteDataAccessToLocal();
WEBCORE_EXPORT static void allowAccessTo(const UserContentURLPattern&);
- WEBCORE_EXPORT static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains);
- WEBCORE_EXPORT static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains);
- WEBCORE_EXPORT static void resetOriginAccessWhitelists();
+ WEBCORE_EXPORT static void addOriginAccessAllowlistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains);
+ WEBCORE_EXPORT static void removeOriginAccessAllowlistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains);
+ WEBCORE_EXPORT static void resetOriginAccessAllowlists();
- static bool isAccessWhiteListed(const SecurityOrigin& activeOrigin, const SecurityOrigin& targetOrigin, const URL& targetURL);
- static bool isAccessWhiteListed(const SecurityOrigin& activeOrigin, const URL& targetURL);
+ static bool isAccessAllowed(const SecurityOrigin& activeOrigin, const SecurityOrigin& targetOrigin, const URL& targetURL);
+ static bool isAccessAllowed(const SecurityOrigin& activeOrigin, const URL& targetURL);
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/UserContentURLPattern.cpp (262921 => 262922)
--- trunk/Source/WebCore/page/UserContentURLPattern.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/UserContentURLPattern.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -32,16 +32,16 @@
namespace WebCore {
-bool UserContentURLPattern::matchesPatterns(const URL& url, const Vector<String>& whitelist, const Vector<String>& blocklist)
+bool UserContentURLPattern::matchesPatterns(const URL& url, const Vector<String>& allowlist, const Vector<String>& blocklist)
{
- // In order for a URL to be a match it has to be present in the whitelist and not present in the blocklist.
- // If there is no whitelist at all, then all URLs are assumed to be in the whitelist.
- bool matchesWhitelist = whitelist.isEmpty();
- if (!matchesWhitelist) {
- for (auto& entry : whitelist) {
+ // In order for a URL to be a match it has to be present in the allowlist and not present in the blocklist.
+ // If there is no allowlist at all, then all URLs are assumed to be in the allowlist.
+ bool matchesAllowlist = allowlist.isEmpty();
+ if (!matchesAllowlist) {
+ for (auto& entry : allowlist) {
UserContentURLPattern contentPattern(entry);
if (contentPattern.matches(url)) {
- matchesWhitelist = true;
+ matchesAllowlist = true;
break;
}
}
@@ -58,7 +58,7 @@
}
}
- return matchesWhitelist && !matchesBlocklist;
+ return matchesAllowlist && !matchesBlocklist;
}
bool UserContentURLPattern::parse(const String& pattern)
Modified: trunk/Source/WebCore/page/UserContentURLPattern.h (262921 => 262922)
--- trunk/Source/WebCore/page/UserContentURLPattern.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/UserContentURLPattern.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -50,7 +50,7 @@
bool matchSubdomains() const { return m_matchSubdomains; }
- static bool matchesPatterns(const URL&, const Vector<String>& whitelist, const Vector<String>& blocklist);
+ static bool matchesPatterns(const URL&, const Vector<String>& allowlist, const Vector<String>& blocklist);
private:
WEBCORE_EXPORT bool parse(const String& pattern);
Modified: trunk/Source/WebCore/page/UserScript.h (262921 => 262922)
--- trunk/Source/WebCore/page/UserScript.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/UserScript.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -41,10 +41,10 @@
UserScript& operator=(const UserScript&) = default;
UserScript& operator=(UserScript&&) = default;
- UserScript(String&& source, URL&& url, Vector<String>&& whitelist, Vector<String>&& blocklist, UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames, WaitForNotificationBeforeInjecting waitForNotification)
+ UserScript(String&& source, URL&& url, Vector<String>&& allowlist, Vector<String>&& blocklist, UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames, WaitForNotificationBeforeInjecting waitForNotification)
: m_source(WTFMove(source))
, m_url(WTFMove(url))
- , m_whitelist(WTFMove(whitelist))
+ , m_allowlist(WTFMove(allowlist))
, m_blocklist(WTFMove(blocklist))
, m_injectionTime(injectionTime)
, m_injectedFrames(injectedFrames)
@@ -54,7 +54,7 @@
const String& source() const { return m_source; }
const URL& url() const { return m_url; }
- const Vector<String>& whitelist() const { return m_whitelist; }
+ const Vector<String>& allowlist() const { return m_allowlist; }
const Vector<String>& blocklist() const { return m_blocklist; }
UserScriptInjectionTime injectionTime() const { return m_injectionTime; }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
@@ -66,7 +66,7 @@
private:
String m_source;
URL m_url;
- Vector<String> m_whitelist;
+ Vector<String> m_allowlist;
Vector<String> m_blocklist;
UserScriptInjectionTime m_injectionTime { UserScriptInjectionTime::DocumentStart };
UserContentInjectedFrames m_injectedFrames { UserContentInjectedFrames::InjectInAllFrames };
@@ -78,7 +78,7 @@
{
encoder << m_source;
encoder << m_url;
- encoder << m_whitelist;
+ encoder << m_allowlist;
encoder << m_blocklist;
encoder << m_injectionTime;
encoder << m_injectedFrames;
@@ -98,9 +98,9 @@
if (!url)
return WTF::nullopt;
- Optional<Vector<String>> whitelist;
- decoder >> whitelist;
- if (!whitelist)
+ Optional<Vector<String>> allowlist;
+ decoder >> allowlist;
+ if (!allowlist)
return WTF::nullopt;
Optional<Vector<String>> blocklist;
@@ -126,7 +126,7 @@
return {{
WTFMove(*source),
WTFMove(*url),
- WTFMove(*whitelist),
+ WTFMove(*allowlist),
WTFMove(*blocklist),
WTFMove(*injectionTime),
WTFMove(*injectedFrames),
Modified: trunk/Source/WebCore/page/UserStyleSheet.h (262921 => 262922)
--- trunk/Source/WebCore/page/UserStyleSheet.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/page/UserStyleSheet.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -43,10 +43,10 @@
{
}
- UserStyleSheet(const String& source, const URL& url, Vector<String>&& whitelist, Vector<String>&& blocklist, UserContentInjectedFrames injectedFrames, UserStyleLevel level, Optional<PageIdentifier> pageID = WTF::nullopt)
+ UserStyleSheet(const String& source, const URL& url, Vector<String>&& allowlist, Vector<String>&& blocklist, UserContentInjectedFrames injectedFrames, UserStyleLevel level, Optional<PageIdentifier> pageID = WTF::nullopt)
: m_source(source)
, m_url(url)
- , m_whitelist(WTFMove(whitelist))
+ , m_allowlist(WTFMove(allowlist))
, m_blocklist(WTFMove(blocklist))
, m_injectedFrames(injectedFrames)
, m_level(level)
@@ -56,7 +56,7 @@
const String& source() const { return m_source; }
const URL& url() const { return m_url; }
- const Vector<String>& whitelist() const { return m_whitelist; }
+ const Vector<String>& allowlist() const { return m_allowlist; }
const Vector<String>& blocklist() const { return m_blocklist; }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
UserStyleLevel level() const { return m_level; }
@@ -65,7 +65,7 @@
private:
String m_source;
URL m_url;
- Vector<String> m_whitelist;
+ Vector<String> m_allowlist;
Vector<String> m_blocklist;
UserContentInjectedFrames m_injectedFrames;
UserStyleLevel m_level;
Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (262921 => 262922)
--- trunk/Source/WebCore/platform/graphics/FontCache.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -198,7 +198,7 @@
static bool isSystemFontForbiddenForEditing(const String&);
#if PLATFORM(COCOA)
- WEBCORE_EXPORT static void setFontWhitelist(const Vector<String>&);
+ WEBCORE_EXPORT static void setFontAllowlist(const Vector<String>&);
#endif
#if PLATFORM(WIN)
IMLangFontLinkType* getFontLinkInterface();
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (262921 => 262922)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -833,19 +833,19 @@
return SynthesisPair(needsSyntheticBold, needsSyntheticOblique);
}
-typedef HashSet<String, ASCIICaseInsensitiveHash> Whitelist;
-static Whitelist& fontWhitelist()
+typedef HashSet<String, ASCIICaseInsensitiveHash> Allowlist;
+static Allowlist& fontAllowlist()
{
- static NeverDestroyed<Whitelist> whitelist;
- return whitelist;
+ static NeverDestroyed<Allowlist> allowlist;
+ return allowlist;
}
-void FontCache::setFontWhitelist(const Vector<String>& inputWhitelist)
+void FontCache::setFontAllowlist(const Vector<String>& inputAllowlist)
{
- Whitelist& whitelist = fontWhitelist();
- whitelist.clear();
- for (auto& item : inputWhitelist)
- whitelist.add(item);
+ Allowlist& allowlist = fontAllowlist();
+ allowlist.clear();
+ for (auto& item : inputAllowlist)
+ allowlist.add(item);
}
class FontDatabase {
@@ -1179,8 +1179,8 @@
static FontLookup platformFontLookupWithFamily(const AtomString& family, FontSelectionRequest request, float size, AllowUserInstalledFonts allowUserInstalledFonts)
{
- const auto& whitelist = fontWhitelist();
- if (!isSystemFont(family.string()) && whitelist.size() && !whitelist.contains(family))
+ const auto& allowlist = fontAllowlist();
+ if (!isSystemFont(family.string()) && allowlist.size() && !allowlist.contains(family))
return { nullptr };
if (equalLettersIgnoringASCIICase(family, ".applesystemuifontserif")
Modified: trunk/Source/WebCore/platform/network/HTTPParsers.cpp (262921 => 262922)
--- trunk/Source/WebCore/platform/network/HTTPParsers.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/platform/network/HTTPParsers.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -141,7 +141,7 @@
for (unsigned i = 0; i < value.length(); ++i) {
UChar c = value[i];
- // First check for alphanumeric for performance reasons then whitelist four delimiter characters.
+ // First check for alphanumeric for performance reasons then allowlist four delimiter characters.
if (isASCIIAlphanumeric(c) || c == ',' || c == '/' || c == ';' || c == '=')
continue;
Modified: trunk/Source/WebCore/rendering/FloatingObjects.h (262921 => 262922)
--- trunk/Source/WebCore/rendering/FloatingObjects.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/rendering/FloatingObjects.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -84,7 +84,7 @@
bool isDescendant() const { return m_isDescendant; }
void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; }
- // FIXME: Callers of these methods are dangerous and should be whitelisted explicitly or removed.
+ // FIXME: Callers of these methods are dangerous and should be allowed explicitly or removed.
RootInlineBox* originatingLine() const { return m_originatingLine.get(); }
void clearOriginatingLine() { m_originatingLine = nullptr; }
void setOriginatingLine(RootInlineBox& line) { m_originatingLine = makeWeakPtr(line); }
Modified: trunk/Source/WebCore/style/ElementRuleCollector.cpp (262921 => 262922)
--- trunk/Source/WebCore/style/ElementRuleCollector.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/style/ElementRuleCollector.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -200,7 +200,7 @@
addMatchedProperties({
&matchedRule.ruleData->styleRule().properties(),
static_cast<uint16_t>(matchedRule.ruleData->linkMatchType()),
- static_cast<uint16_t>(matchedRule.ruleData->propertyWhitelistType()),
+ static_cast<uint16_t>(matchedRule.ruleData->propertyAllowlistType()),
matchedRule.styleScopeOrdinal
}, declarationOrigin);
}
Modified: trunk/Source/WebCore/style/ElementRuleCollector.h (262921 => 262922)
--- trunk/Source/WebCore/style/ElementRuleCollector.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/style/ElementRuleCollector.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -67,7 +67,7 @@
struct MatchedProperties {
RefPtr<const StyleProperties> properties;
uint16_t linkMatchType { SelectorChecker::MatchAll };
- uint16_t whitelistType { PropertyWhitelistNone };
+ uint16_t allowlistType { PropertyAllowlistNone };
ScopeOrdinal styleScopeOrdinal { ScopeOrdinal::Element };
};
Modified: trunk/Source/WebCore/style/PropertyCascade.cpp (262921 => 262922)
--- trunk/Source/WebCore/style/PropertyCascade.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/style/PropertyCascade.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -242,7 +242,7 @@
bool PropertyCascade::addMatch(const MatchedProperties& matchedProperties, CascadeLevel cascadeLevel, bool important)
{
auto& styleProperties = *matchedProperties.properties;
- auto propertyWhitelistType = static_cast<PropertyWhitelistType>(matchedProperties.whitelistType);
+ auto propertyAllowlistType = static_cast<PropertyAllowlistType>(matchedProperties.allowlistType);
bool hasImportantProperties = false;
for (unsigned i = 0, count = styleProperties.propertyCount(); i < count; ++i) {
@@ -262,10 +262,10 @@
CSSPropertyID propertyID = current.id();
#if ENABLE(VIDEO)
- if (propertyWhitelistType == PropertyWhitelistCue && !isValidCueStyleProperty(propertyID))
+ if (propertyAllowlistType == PropertyAllowlistCue && !isValidCueStyleProperty(propertyID))
continue;
#endif
- if (propertyWhitelistType == PropertyWhitelistMarker && !isValidMarkerStyleProperty(propertyID))
+ if (propertyAllowlistType == PropertyAllowlistMarker && !isValidMarkerStyleProperty(propertyID))
continue;
if (shouldApplyPropertyInParseOrder(propertyID))
Modified: trunk/Source/WebCore/style/RuleData.cpp (262921 => 262922)
--- trunk/Source/WebCore/style/RuleData.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/style/RuleData.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -137,25 +137,25 @@
return false;
}
-static inline PropertyWhitelistType determinePropertyWhitelistType(const CSSSelector* selector)
+static inline PropertyAllowlistType determinePropertyAllowlistType(const CSSSelector* selector)
{
for (const CSSSelector* component = selector; component; component = component->tagHistory()) {
#if ENABLE(VIDEO)
if (component->match() == CSSSelector::PseudoElement && (component->pseudoElementType() == CSSSelector::PseudoElementCue || component->value() == TextTrackCue::cueShadowPseudoId()))
- return PropertyWhitelistCue;
+ return PropertyAllowlistCue;
#endif
if (component->match() == CSSSelector::PseudoElement && component->pseudoElementType() == CSSSelector::PseudoElementMarker)
- return PropertyWhitelistMarker;
+ return PropertyAllowlistMarker;
if (const auto* selectorList = selector->selectorList()) {
for (const auto* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
- auto whitelistType = determinePropertyWhitelistType(subSelector);
- if (whitelistType != PropertyWhitelistNone)
- return whitelistType;
+ auto allowlistType = determinePropertyAllowlistType(subSelector);
+ if (allowlistType != PropertyAllowlistNone)
+ return allowlistType;
}
}
}
- return PropertyWhitelistNone;
+ return PropertyAllowlistNone;
}
RuleData::RuleData(const StyleRule& styleRule, unsigned selectorIndex, unsigned selectorListIndex, unsigned position)
@@ -167,7 +167,7 @@
, m_canMatchPseudoElement(selectorCanMatchPseudoElement(*selector()))
, m_containsUncommonAttributeSelector(computeContainsUncommonAttributeSelector(*selector()))
, m_linkMatchType(SelectorChecker::determineLinkMatchType(selector()))
- , m_propertyWhitelistType(determinePropertyWhitelistType(selector()))
+ , m_propertyAllowlistType(determinePropertyAllowlistType(selector()))
, m_isEnabled(true)
, m_descendantSelectorIdentifierHashes(SelectorFilter::collectHashes(*selector()))
{
Modified: trunk/Source/WebCore/style/RuleData.h (262921 => 262922)
--- trunk/Source/WebCore/style/RuleData.h 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebCore/style/RuleData.h 2020-06-11 20:47:21 UTC (rev 262922)
@@ -27,11 +27,11 @@
namespace WebCore {
namespace Style {
-enum PropertyWhitelistType {
- PropertyWhitelistNone = 0,
- PropertyWhitelistMarker,
+enum PropertyAllowlistType {
+ PropertyAllowlistNone = 0,
+ PropertyAllowlistMarker,
#if ENABLE(VIDEO)
- PropertyWhitelistCue
+ PropertyAllowlistCue
#endif
};
@@ -65,7 +65,7 @@
MatchBasedOnRuleHash matchBasedOnRuleHash() const { return static_cast<MatchBasedOnRuleHash>(m_matchBasedOnRuleHash); }
bool containsUncommonAttributeSelector() const { return m_containsUncommonAttributeSelector; }
unsigned linkMatchType() const { return m_linkMatchType; }
- PropertyWhitelistType propertyWhitelistType() const { return static_cast<PropertyWhitelistType>(m_propertyWhitelistType); }
+ PropertyAllowlistType propertyAllowlistType() const { return static_cast<PropertyAllowlistType>(m_propertyAllowlistType); }
bool isEnabled() const { return m_isEnabled; }
void setEnabled(bool value) { m_isEnabled = value; }
@@ -84,7 +84,7 @@
unsigned m_canMatchPseudoElement : 1;
unsigned m_containsUncommonAttributeSelector : 1;
unsigned m_linkMatchType : 2; // SelectorChecker::LinkMatchMask
- unsigned m_propertyWhitelistType : 2;
+ unsigned m_propertyAllowlistType : 2;
unsigned m_isEnabled : 1;
SelectorFilter::Hashes m_descendantSelectorIdentifierHashes;
};
Modified: trunk/Source/WebKit/ChangeLog (262921 => 262922)
--- trunk/Source/WebKit/ChangeLog 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKit/ChangeLog 2020-06-11 20:47:21 UTC (rev 262922)
@@ -1,3 +1,24 @@
+2020-06-11 Beth Dakin <[email protected]>
+
+ Replace instances of whitelist in WebCore with allowlist
+ https://bugs.webkit.org/show_bug.cgi?id=213068
+
+ Reviewed by Tim Horton.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
+ (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
+ (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<UserStyleSheet>::encode):
+ (IPC::ArgumentCoder<UserStyleSheet>::decode):
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
+ (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
+ (WebKit::InjectedBundle::resetOriginAccessWhitelists):
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+
2020-06-11 Jonathan Bedard <[email protected]>
WebKit: Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (262921 => 262922)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -901,17 +901,17 @@
void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
{
- SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ SecurityPolicy::addOriginAccessAllowlistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
}
void NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
{
- SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ SecurityPolicy::removeOriginAccessAllowlistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
}
void NetworkConnectionToWebProcess::resetOriginAccessWhitelists()
{
- SecurityPolicy::resetOriginAccessWhitelists();
+ SecurityPolicy::resetOriginAccessAllowlists();
}
Optional<NetworkActivityTracker> NetworkConnectionToWebProcess::startTrackingResourceLoad(PageIdentifier pageID, ResourceLoadIdentifier resourceID, bool isTopResource)
Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (262921 => 262922)
--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -2080,7 +2080,7 @@
{
encoder << userStyleSheet.source();
encoder << userStyleSheet.url();
- encoder << userStyleSheet.whitelist();
+ encoder << userStyleSheet.allowlist();
encoder << userStyleSheet.blocklist();
encoder.encodeEnum(userStyleSheet.injectedFrames());
encoder.encodeEnum(userStyleSheet.level());
@@ -2097,8 +2097,8 @@
if (!decoder.decode(url))
return false;
- Vector<String> whitelist;
- if (!decoder.decode(whitelist))
+ Vector<String> allowlist;
+ if (!decoder.decode(allowlist))
return false;
Vector<String> blocklist;
@@ -2118,7 +2118,7 @@
if (!pageID)
return false;
- userStyleSheet = UserStyleSheet(source, url, WTFMove(whitelist), WTFMove(blocklist), injectedFrames, level, WTFMove(*pageID));
+ userStyleSheet = UserStyleSheet(source, url, WTFMove(allowlist), WTFMove(blocklist), injectedFrames, level, WTFMove(*pageID));
return true;
}
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (262921 => 262922)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -395,7 +395,7 @@
void InjectedBundle::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
{
- SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ SecurityPolicy::addOriginAccessAllowlistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains }, 0);
}
@@ -402,13 +402,13 @@
void InjectedBundle::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)
{
- SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ SecurityPolicy::removeOriginAccessAllowlistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains }, 0);
}
void InjectedBundle::resetOriginAccessWhitelists()
{
- SecurityPolicy::resetOriginAccessWhitelists();
+ SecurityPolicy::resetOriginAccessAllowlists();
WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ResetOriginAccessWhitelists { }, 0);
}
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (262921 => 262922)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-06-11 20:47:21 UTC (rev 262922)
@@ -212,7 +212,7 @@
[NSURLCache setSharedURLCache:urlCache.get()];
#if PLATFORM(MAC)
- WebCore::FontCache::setFontWhitelist(parameters.fontWhitelist);
+ WebCore::FontCache::setFontAllowlist(parameters.fontWhitelist);
#endif
m_compositingRenderServerPort = WTFMove(parameters.acceleratedCompositingPort);
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (262921 => 262922)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2020-06-11 20:47:21 UTC (rev 262922)
@@ -1,3 +1,16 @@
+2020-06-11 Beth Dakin <[email protected]>
+
+ Replace instances of whitelist in WebCore with allowlist
+ https://bugs.webkit.org/show_bug.cgi?id=213068
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebView.mm:
+ (+[WebView _addOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
+ (+[WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]):
+ (+[WebView _resetOriginAccessWhitelists]):
+ (+[WebView _setFontWhitelist:]):
+
2020-06-11 David Kilzer <[email protected]>
[IPC] Adopt enum class for DragSourceAction
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (262921 => 262922)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2020-06-11 20:47:21 UTC (rev 262922)
@@ -4725,17 +4725,17 @@
+ (void)_addOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains
{
- WebCore::SecurityPolicy::addOriginAccessWhitelistEntry(WebCore::SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ WebCore::SecurityPolicy::addOriginAccessAllowlistEntry(WebCore::SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
}
+ (void)_removeOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains
{
- WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry(WebCore::SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
+ WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry(WebCore::SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains);
}
+ (void)_resetOriginAccessWhitelists
{
- WebCore::SecurityPolicy::resetOriginAccessWhitelists();
+ WebCore::SecurityPolicy::resetOriginAccessAllowlists();
}
- (BOOL)_isViewVisible
@@ -10252,7 +10252,7 @@
#if !PLATFORM(MAC)
UNUSED_PARAM(whitelist);
#else
- WebCore::FontCache::setFontWhitelist(makeVector<String>(whitelist));
+ WebCore::FontCache::setFontAllowlist(makeVector<String>(whitelist));
#endif
}
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (262921 => 262922)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2020-06-11 20:45:39 UTC (rev 262921)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2020-06-11 20:47:21 UTC (rev 262922)
@@ -7156,19 +7156,19 @@
HRESULT WebView::addOriginAccessWhitelistEntry(_In_ BSTR sourceOrigin, _In_ BSTR destinationProtocol, _In_ BSTR destinationHost, BOOL allowDestinationSubdomains)
{
- SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(toString(sourceOrigin)).get(), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
+ SecurityPolicy::addOriginAccessAllowlistEntry(SecurityOrigin::createFromString(toString(sourceOrigin)).get(), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
return S_OK;
}
HRESULT WebView::removeOriginAccessWhitelistEntry(_In_ BSTR sourceOrigin, _In_ BSTR destinationProtocol, _In_ BSTR destinationHost, BOOL allowDestinationSubdomains)
{
- SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(toString(sourceOrigin)).get(), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
+ SecurityPolicy::removeOriginAccessAllowlistEntry(SecurityOrigin::createFromString(toString(sourceOrigin)).get(), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);
return S_OK;
}
HRESULT WebView::resetOriginAccessWhitelists()
{
- SecurityPolicy::resetOriginAccessWhitelists();
+ SecurityPolicy::resetOriginAccessAllowlists();
return S_OK;
}