Bug 213064

Summary: Replace instances of blacklist in WebCore with blocklist
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebCore Misc.Assignee: Beth Dakin <bdakin>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cdumez, dino, esprehn+autocc, ews-watchlist, graouts, kangil.han, kondapallykalyan, sam, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 213092    
Attachments:
Description Flags
Patch none

Description Beth Dakin 2020-06-10 20:42:06 PDT
Continue the work started in https://bugs.webkit.org/show_bug.cgi?id=213000 to replace instances of "blacklist" in WebCore with "blocklist".
Comment 1 Beth Dakin 2020-06-10 20:44:00 PDT
Created attachment 401616 [details]
Patch
Comment 2 Tim Horton 2020-06-10 21:00:47 PDT
Comment on attachment 401616 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401616&action=review

> Source/WebCore/page/UserContentURLPattern.cpp:37
> +    // In order for a URL to be a match it has to be present in the whitelist and not present in the blocklist.

You missed a "whitelist"

> Source/WebCore/page/UserContentURLPattern.cpp:61
> +    return matchesWhitelist && !matchesBlocklist;

and here
Comment 3 Beth Dakin 2020-06-10 21:02:58 PDT
(In reply to Tim Horton from comment #2)
> Comment on attachment 401616 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401616&action=review
> 
> > Source/WebCore/page/UserContentURLPattern.cpp:37
> > +    // In order for a URL to be a match it has to be present in the whitelist and not present in the blocklist.
> 
> You missed a "whitelist"
> 
> > Source/WebCore/page/UserContentURLPattern.cpp:61
> > +    return matchesWhitelist && !matchesBlocklist;
> 
> and here

Oh I missed ALL of whitelists! I thought I'd do a second patch just to keep the patches smaller, but it's an arbitrary division.
Comment 4 EWS 2020-06-10 21:23:25 PDT
Committed r262894: <https://trac.webkit.org/changeset/262894>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401616 [details].
Comment 5 Radar WebKit Bug Importer 2020-06-10 21:24:17 PDT
<rdar://problem/64238706>
Comment 6 Sam Weinig 2020-06-11 11:49:02 PDT
Comment on attachment 401616 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401616&action=review

> Source/WebCore/page/UserStyleSheet.h:60
>      const Vector<String>& whitelist() const { return m_whitelist; }
> -    const Vector<String>& blacklist() const { return m_blacklist; }
> +    const Vector<String>& blocklist() const { return m_blocklist; }

I think we should match the naming elsewhere, and rename these to includeMatchPatternStrings/excludeMatchPatternStrings. This has the added benefit of actually explaining what these do. Alternatively, we could use the terms the developer.apple.com uses (https://developer.apple.com/documentation/safariservices/safari_app_extensions/safari_app_extension_info_property_list_keys/about_content_script_and_style_sheet_keys), allowedURLPatterns/excludedURLPatterns.

Either way, we should use the same terminology for both UserStyleSheet and UserScript.

> Source/WebCore/platform/mac/PasteboardMac.mm:570
> -    // Blacklist types that might contain subframe information.
> +    // Blocklist types that might contain subframe information.

This sentence no longer makes sense. I would replace Blocklist with "Reject"