Bug 188133 - Check with SafeBrowsing during navigation in WKWebView
Summary: Check with SafeBrowsing during navigation in WKWebView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-27 16:53 PDT by Alex Christensen
Modified: 2018-08-09 15:35 PDT (History)
7 users (show)

See Also:


Attachments
Patch (26.61 KB, patch)
2018-07-27 16:58 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (27.23 KB, patch)
2018-07-27 17:09 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews200 for win-future (12.99 MB, application/zip)
2018-07-28 15:32 PDT, EWS Watchlist
no flags Details
Patch (28.75 KB, patch)
2018-08-01 14:18 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (28.77 KB, patch)
2018-08-01 14:26 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (28.85 KB, patch)
2018-08-01 14:37 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (28.85 KB, patch)
2018-08-01 15:01 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (28.85 KB, patch)
2018-08-01 16:02 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (29.89 KB, patch)
2018-08-02 09:59 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (30.43 KB, patch)
2018-08-02 11:36 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (37.54 KB, patch)
2018-08-06 17:32 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2018-07-27 16:53:06 PDT
Implement safe browsing in WKWebView
Comment 1 Alex Christensen 2018-07-27 16:58:09 PDT
Created attachment 345975 [details]
Patch
Comment 2 Alex Christensen 2018-07-27 17:09:29 PDT
Created attachment 345976 [details]
Patch
Comment 3 EWS Watchlist 2018-07-28 15:32:30 PDT
Comment on attachment 345976 [details]
Patch

Attachment 345976 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8685614

New failing tests:
http/tests/security/local-video-source-from-remote.html
Comment 4 EWS Watchlist 2018-07-28 15:32:41 PDT
Created attachment 346003 [details]
Archive of layout-test-results from ews200 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews200  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 5 Alex Christensen 2018-08-01 14:18:40 PDT
Created attachment 346297 [details]
Patch
Comment 6 Alex Christensen 2018-08-01 14:26:38 PDT
Created attachment 346299 [details]
Patch
Comment 7 Alex Christensen 2018-08-01 14:37:16 PDT
Created attachment 346301 [details]
Patch
Comment 8 Alex Christensen 2018-08-01 15:01:35 PDT
Created attachment 346305 [details]
Patch
Comment 9 Alex Christensen 2018-08-01 16:02:44 PDT
Created attachment 346309 [details]
Patch
Comment 10 Alex Christensen 2018-08-02 09:59:33 PDT
Created attachment 346388 [details]
Patch
Comment 11 Chris Dumez 2018-08-02 10:54:42 PDT
Comment on attachment 346388 [details]
Patch

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

r=me with suggestion.

> Source/WebKit/UIProcess/WebPageProxy.cpp:4152
> +    listener->didReceiveSafeBrowsingResults({ });

This looks hackish/fragile. Is this temporary? I think I'd much prefer we pass a ShouldExpectSafeBrowsingResult { No, Yes } parameter.

> Source/WebKit/UIProcess/WebPageProxy.cpp:4189
> +    listener->didReceiveSafeBrowsingResults({ });

ditto.
Comment 12 Alex Christensen 2018-08-02 11:36:34 PDT
Created attachment 346398 [details]
Patch
Comment 13 Alex Christensen 2018-08-02 13:13:20 PDT
http://trac.webkit.org/r234513
Comment 14 Radar WebKit Bug Importer 2018-08-02 13:15:25 PDT
<rdar://problem/42869909>
Comment 15 Ryan Haddad 2018-08-02 17:33:25 PDT
14 API tests are failing the assert(s) added with this change:

https://build.webkit.org/builders/Apple%20High%20Sierra%20Debug%20WK2%20%28Tests%29/builds/4338/steps/run-api-tests/logs/stdio
    TestWebKitAPI.WebKit.DecidePolicyForNavigationActionForPOSTFormSubmissionThatRedirectsToPOST
        ASSERTION FAILED: !m_policyResult
        /Volumes/Data/slave/highsierra-debug/build/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp(77) : void WebKit::WebFramePolicyListenerProxy::ignore()
        1   0x106c661f9 WTFCrash
        2   0x10b74632b WTFCrashWithInfo(int, char const*, char const*, int)
        3   0x10c1cfd47 WebKit::WebFramePolicyListenerProxy::ignore()
        4   0x10c1d13f4 WebKit::WebFrameProxy::webProcessWillShutDown()
        5   0x10c6448fd WebKit::WebProcessProxy::disconnectFramesFromPage(WebKit::WebPageProxy*)
        6   0x10c3b1a30 WebKit::WebPageProxy::close()
        7   0x10c90f0ea -[WKWebView dealloc]
        8   0x7fff6bf6b042 (anonymous namespace)::AutoreleasePoolPage::pop(void*)
        9   0x7fff447a88e6 _CFAutoreleasePoolPop
        10  0x7fff468e68ad -[NSAutoreleasePool drain]
        11  0x1061d9cd7 main
        12  0x7fff6cb8c015 start
Comment 16 Ryan Haddad 2018-08-03 08:26:19 PDT
Reverted r234513 for reason:

14 API tests fail the assertions added in this change.

Committed r234545: <https://trac.webkit.org/changeset/234545>
Comment 17 Ryan Haddad 2018-08-03 08:35:48 PDT
Assertion failures were also seen with the following tests on High Sierra:

fast/events/open-window-from-another-frame.html
fast/events/popup-blocked-from-fake-user-gesture.html
http/tests/xmlhttprequest/access-control-response-with-body-sync.html

This test started failing:
http/tests/navigation/keyboard-events-during-provisional-navigation.html

https://build.webkit.org/results/Apple%20High%20Sierra%20Debug%20WK2%20(Tests)/r234541%20(4349)/results.html
Comment 18 Alex Christensen 2018-08-03 10:58:32 PDT
Recommitted without those assertions in http://trac.webkit.org/r234552
The assertions are not valid because ignore is called during teardown even if the listener has already been used.  See r234462 for a change motivated by the same reason.
Comment 19 Ryan Haddad 2018-08-03 16:00:37 PDT
(In reply to Alex Christensen from comment #18)
> Recommitted without those assertions in http://trac.webkit.org/r234552

http/tests/navigation/keyboard-events-during-provisional-navigation.html is failing again after the commit. It is not clear to me if the new console output is expected or not.

--- /Volumes/Data/slave/highsierra-release-tests-wk2/build/layout-test-results/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt
+++ /Volumes/Data/slave/highsierra-release-tests-wk2/build/layout-test-results/http/tests/navigation/keyboard-events-during-provisional-navigation-actual.txt
@@ -10,6 +10,8 @@
 CONSOLE MESSAGE: line 55: Pasting text "d".
 CONSOLE MESSAGE: line 58: Input element value after text input events: "".
 CONSOLE MESSAGE: line 20: Pressing "z" with access key modifiers should navigate to resources/keyboard-events-after-navigation.html.
+CONSOLE MESSAGE: line 18: keydownevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 18: keyupevent dispatched (isTrusted: true).

https://build.webkit.org/results/Apple%20High%20Sierra%20Release%20WK2%20(Tests)/r234559%20(5991)/results.html
Comment 20 Truitt Savell 2018-08-06 09:47:12 PDT
(In reply to Ryan Haddad from comment #19)
> (In reply to Alex Christensen from comment #18)
> > Recommitted without those assertions in http://trac.webkit.org/r234552
> 
> http/tests/navigation/keyboard-events-during-provisional-navigation.html is
> failing again after the commit. It is not clear to me if the new console
> output is expected or not.
> 
> ---
> /Volumes/Data/slave/highsierra-release-tests-wk2/build/layout-test-results/
> http/tests/navigation/keyboard-events-during-provisional-navigation-expected.
> txt
> +++
> /Volumes/Data/slave/highsierra-release-tests-wk2/build/layout-test-results/
> http/tests/navigation/keyboard-events-during-provisional-navigation-actual.
> txt
> @@ -10,6 +10,8 @@
>  CONSOLE MESSAGE: line 55: Pasting text "d".
>  CONSOLE MESSAGE: line 58: Input element value after text input events: "".
>  CONSOLE MESSAGE: line 20: Pressing "z" with access key modifiers should
> navigate to resources/keyboard-events-after-navigation.html.
> +CONSOLE MESSAGE: line 18: keydownevent dispatched (isTrusted: true).
> +CONSOLE MESSAGE: line 18: keyupevent dispatched (isTrusted: true).
> 
> https://build.webkit.org/results/
> Apple%20High%20Sierra%20Release%20WK2%20(Tests)/r234559%20(5991)/results.html

svg/custom/anchor-on-use.svg Is also failing after this revision with the failure first happening after https://trac.webkit.org/changeset/234513/webkit. 

Image Diff:
https://build.webkit.org/results/Apple%20High%20Sierra%20Debug%20WK2%20(Tests)/r234600%20(4376)/svg/custom/anchor-on-use-diffs.html
Comment 21 Ryan Haddad 2018-08-06 13:17:11 PDT
Reverted r234552 for reason:

Introduced 2 layout test failures on High Sierra.

Committed r234615: <https://trac.webkit.org/changeset/234615>
Comment 22 Alex Christensen 2018-08-06 17:32:53 PDT
Created attachment 346669 [details]
Patch
Comment 23 WebKit Commit Bot 2018-08-06 18:13:45 PDT
Comment on attachment 346669 [details]
Patch

Clearing flags on attachment: 346669

Committed r234640: <https://trac.webkit.org/changeset/234640>
Comment 24 WebKit Commit Bot 2018-08-06 18:13:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 25 Truitt Savell 2018-08-07 09:22:38 PDT
After <https://trac.webkit.org/changeset/234640> 

We have API assertion failures again. 

API failure:
https://build.webkit.org/builders/Apple%20High%20Sierra%20Debug%20WK1%20%28Tests%29/builds/5055/steps/run-api-tests/logs/stdio

Looks like those were not omitted in this patch. additionally after the rebaselining of  http/tests/navigation/keyboard-events-during-provisional-navigation.htmlthe test is failing in Sierra WK2. Looks like it just needs to be baselined on that build as well.

Test History:
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fnavigation%2Fkeyboard-events-during-provisional-navigation.html

As well as an internal build is broken.
Comment 26 Alex Christensen 2018-08-07 10:37:03 PDT
http://trac.webkit.org/r234658 should make everything good.