Bug 195965

Summary: Add SPI to inform applications of WKContentRuleList actions
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, ggaren, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=196151
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
Patch
ews-watchlist: commit-queue-
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
patch
none
Patch commit-queue: commit-queue-

Description Alex Christensen 2019-03-19 14:49:44 PDT
Add SPI to inform applications of WKContentRuleList actions
Comment 1 Alex Christensen 2019-03-19 14:53:17 PDT
Created attachment 365232 [details]
Patch
Comment 2 Alex Christensen 2019-03-19 14:53:20 PDT
<rdar://problem/42664365>
Comment 3 Alex Christensen 2019-03-19 15:38:10 PDT
Created attachment 365247 [details]
Patch
Comment 4 Alex Christensen 2019-03-19 16:49:23 PDT
Created attachment 365262 [details]
Patch
Comment 5 Alex Christensen 2019-03-19 17:42:06 PDT
Created attachment 365273 [details]
Patch
Comment 6 Alex Christensen 2019-03-19 19:44:28 PDT
Created attachment 365295 [details]
Patch
Comment 7 EWS Watchlist 2019-03-19 22:19:06 PDT
Comment on attachment 365295 [details]
Patch

Attachment 365295 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11575515

New failing tests:
http/tests/contentextensions/popups.html
Comment 8 EWS Watchlist 2019-03-19 22:19:08 PDT
Created attachment 365311 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 9 Alex Christensen 2019-03-19 22:43:45 PDT
Created attachment 365316 [details]
Patch
Comment 10 EWS Watchlist 2019-03-20 00:16:29 PDT
Comment on attachment 365316 [details]
Patch

Attachment 365316 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/11576607

New failing tests:
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
Comment 11 EWS Watchlist 2019-03-20 00:16:31 PDT
Created attachment 365323 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 12 Alex Christensen 2019-03-20 11:52:38 PDT
Created attachment 365373 [details]
patch
Comment 13 EWS Watchlist 2019-03-20 11:55:50 PDT
Attachment 365373 [details] did not pass style-queue:


ERROR: Source/WebCore/page/ChromeClient.h:387:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
Total errors found: 1 in 41 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Geoffrey Garen 2019-03-20 16:52:11 PDT
Comment on attachment 365373 [details]
patch

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

r=me

> Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:96
> +- (void)_webView:(WKWebView *)webView contentRuleListWithIdentifier:(NSString *)identifier performedActionOnURL:(NSURL *)url blockedLoad:(BOOL)blockedLoad blockedCookies:(BOOL)blockedCookies madeHTTPS:(BOOL)madeHTTPS notifications:(NSArray<NSString *> *)notifications WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

I'd recommend ....performedAction:(_WKContentRuleListAction *)action forURL:....

Then we can put the BOOLs in the object, and add if needed in future, and it's slightly nicer to write client code.

_WKContentRuleListAction can just wrap WebCore's struct.

> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:657
> +            auto notifications = adoptNS([[NSMutableArray alloc] initWithCapacity:result.notifications.size()]);

You can skip this allocation if there are no notifications.
Comment 15 Alex Christensen 2019-03-20 18:00:02 PDT
Created attachment 365453 [details]
Patch
Comment 16 EWS Watchlist 2019-03-20 18:03:06 PDT
Attachment 365453 [details] did not pass style-queue:


ERROR: Source/WebKit/UIProcess/API/Cocoa/_WKContentRuleListActionInternal.h:27:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/page/ChromeClient.h:387:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
Total errors found: 2 in 58 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 17 WebKit Commit Bot 2019-03-20 20:08:01 PDT
Comment on attachment 365453 [details]
Patch

Rejecting attachment 365453 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 365453, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: https://webkit-queues.webkit.org/results/11590568
Comment 18 Alex Christensen 2019-03-21 13:24:16 PDT
https://trac.webkit.org/changeset/243319/webkit