Bug 184897 - Web Inspector: Annotate Same-Site cookies
Summary: Web Inspector: Annotate Same-Site cookies
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on: 159464
Blocks: 186137
  Show dependency treegraph
 
Reported: 2018-04-23 14:27 PDT by Daniel Bates
Modified: 2018-05-31 12:06 PDT (History)
10 users (show)

See Also:


Attachments
[Patch] Work-in-progress (46.54 KB, patch)
2018-05-25 12:12 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
[Patch] Work-in-progress (46.58 KB, patch)
2018-05-25 12:29 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch and layout test (47.59 KB, patch)
2018-05-25 14:16 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 Brian 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 Build Bot 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 Build Bot 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 Brian 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 Build Bot 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.