Bug 184897

Summary: Web Inspector: Annotate Same-Site cookies
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Web InspectorAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 159464    
Bug Blocks: 186137    
Attachments:
Description Flags
[Patch] Work-in-progress
none
[Patch] Work-in-progress
none
Patch and layout test none

Description Daniel Bates 2018-04-23 14:27:22 PDT
We should annotate Same-Site cookies in the Web Inspector. In particular, we should annotate the Same-Site policy (strict or lax) for each cookie.
Comment 1 BJ Burg 2018-05-03 09:58:56 PDT
<rdar://problem/35178209>
Comment 2 Daniel Bates 2018-05-25 12:12:58 PDT
Created attachment 341307 [details]
[Patch] Work-in-progress
Comment 3 Daniel Bates 2018-05-25 12:29:32 PDT
Created attachment 341309 [details]
[Patch] Work-in-progress

Rebased patch following the landing of the patch for bug #185041.
Comment 4 EWS Watchlist 2018-05-25 12:31:12 PDT
Attachment 341309 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/cocoa/CookieCocoa.mm:129:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Joseph Pecoraro 2018-05-25 12:49:28 PDT
Comment on attachment 341309 [details]
[Patch] Work-in-progress

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

Nice, the patch looks good to me.

> Source/WebInspectorUI/UserInterface/Models/Cookie.js:114
> +            console.error("Invalid SameSite type", sameSiteType);

Might as well return something here just in case. Probably `return sameSiteType`.

> Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js:93
> +            cell.textContent = cookie.sameSite == WI.Cookie.SameSiteType.None ? emDash : WI.Cookie.displayNameForSameSiteType(cookie.sameSite);

Style: ===
Comment 6 Daniel Bates 2018-05-25 14:16:46 PDT
Created attachment 341326 [details]
Patch and layout test
Comment 7 EWS Watchlist 2018-05-25 14:18:25 PDT
Attachment 341326 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/cocoa/CookieCocoa.mm:133:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Daniel Bates 2018-05-25 14:18:37 PDT
(In reply to Joseph Pecoraro from comment #5)
> > Source/WebInspectorUI/UserInterface/Models/Cookie.js:114
> > +            console.error("Invalid SameSite type", sameSiteType);
> 
> Might as well return something here just in case. Probably `return
> sameSiteType`.
> 

Fixed.

> > Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js:93
> > +            cell.textContent = cookie.sameSite == WI.Cookie.SameSiteType.None ? emDash : WI.Cookie.displayNameForSameSiteType(cookie.sameSite);
> 
> Style: ===

Fixed.
Comment 9 BJ Burg 2018-05-25 14:29:42 PDT
Comment on attachment 341326 [details]
Patch and layout test

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

r=me, great patch. Let's wait for EWS, I anticipate nitpicking platform-specific results.

> Source/WebCore/platform/Cookie.h:171
> +    using values = EnumValues<

This is cool.

> Source/WebCore/platform/network/cocoa/CookieCocoa.mm:39
> +static NSString * const NSHTTPCookieSameSiteStrict = @"strict";

This stuff should be in NSHTTPCookieSPI, but that file doesn't exist yet.

> LayoutTests/http/tests/inspector/network/har/har-page-expected.txt:718
> +              "sameSite": "Lax"

I believe we may need different expectations per port, if this isn't going to be propagated. Let's see what EWS says.
Comment 10 EWS Watchlist 2018-05-25 15:46:19 PDT
Comment on attachment 341326 [details]
Patch and layout test

Attachment 341326 [details] did not pass jsc-ews (mac):
Output: http://webkit-queues.webkit.org/results/7804230

New failing tests:
stress/ftl-put-by-id-setter-exception-interesting-live-state.js.ftl-eager-no-cjit
Comment 11 Daniel Bates 2018-05-30 16:41:31 PDT
(In reply to Build Bot from comment #10)
> Comment on attachment 341326 [details]
> Patch and layout test
> 
> Attachment 341326 [details] did not pass jsc-ews (mac):
> Output: http://webkit-queues.webkit.org/results/7804230
> 
> New failing tests:
> stress/ftl-put-by-id-setter-exception-interesting-live-state.js.ftl-eager-no-
> cjit

I am unclear how a Web Inspector change could cause this test failure.
Comment 12 Daniel Bates 2018-05-30 16:42:42 PDT
Comment on attachment 341326 [details]
Patch and layout test

Clearing flags on attachment: 341326

Committed r232318: <https://trac.webkit.org/changeset/232318>
Comment 13 Daniel Bates 2018-05-30 16:42:44 PDT
All reviewed patches have been landed.  Closing bug.