Bug 48226 - Web Inspector: display cookies associated with request
Summary: Web Inspector: display cookies associated with request
Status: RESOLVED DUPLICATE of bug 16531
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 02:48 PDT by Andrey Kosyakov
Modified: 2010-10-25 10:18 PDT (History)
12 users (show)

See Also:


Attachments
patch (30.76 KB, patch)
2010-10-25 02:56 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
screenshot (22.53 KB, image/png)
2010-10-25 04:31 PDT, Andrey Kosyakov
no flags Details
patch (30.57 KB, patch)
2010-10-25 04:34 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
patch (30.59 KB, patch)
2010-10-25 05:09 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
updated screenshot (17.29 KB, image/png)
2010-10-25 09:10 PDT, Andrey Kosyakov
no flags Details
patch (35.48 KB, patch)
2010-10-25 09:13 PDT, Andrey Kosyakov
pfeldman: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kosyakov 2010-10-25 02:48:49 PDT
Provide a tab in resource view with a list of cookies if Cookie/Set-Cookie headers are available.
Comment 1 Andrey Kosyakov 2010-10-25 02:56:06 PDT
Created attachment 71723 [details]
patch
Comment 2 WebKit Review Bot 2010-10-25 02:59:54 PDT
Attachment 71723 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/inspector/front-end/ResourceCookiesView.js:1:  One or more unexpected \r (^M) found; better to use only a \n  [whitespace/carriage_return] [1]
Suppressing further [whitespace/carriage_return] reports for this file.
WebCore/inspector/front-end/CookieItemsViewBase.js:1:  One or more unexpected \r (^M) found; better to use only a \n  [whitespace/carriage_return] [1]
Suppressing further [whitespace/carriage_return] reports for this file.
Total errors found: 251 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andrey Kosyakov 2010-10-25 04:31:06 PDT
Created attachment 71731 [details]
screenshot
Comment 4 Andrey Kosyakov 2010-10-25 04:34:50 PDT
Created attachment 71732 [details]
patch

- Fixed "disclosure" flag on name column
- Fixed EOLs
Comment 5 Andrey Kosyakov 2010-10-25 05:09:20 PDT
Created attachment 71735 [details]
patch

- Fixed resize() not being called sometimes
- Fixed cookies being shown in Sources Panel
Comment 6 Timothy Hatcher 2010-10-25 07:20:49 PDT
This looks nice. But they why re some of the column dividers 1px off from the header dividers? Also should size have a "B" unit?
Comment 7 Timothy Hatcher 2010-10-25 07:21:42 PDT
THE HTTP and Secure columns can be smaller.
Comment 8 Andrey Kosyakov 2010-10-25 09:08:23 PDT
(In reply to comment #7)

> This looks nice. But they why re some of the column dividers 1px off from the header dividers? 

My bad, that was a bug with DataGrid.updateWidths() not being called, fixed it since then.

> Also should size have a "B" unit?

This was on purpose -- I thought that given cookies are supposed to be under few KB, it would be a good idea not to use bytesToString() -- first, to make large cookie stand out visually by having a large number in table, but also to reduce clutter due to "B" being everywhere. I realize we could be doing this for consistency with other places, though, so I'll bring bytesToString() back if you say so.

> THE HTTP and Secure columns can be smaller.

As it transpired, DataGrid.autoSizeColumns() was only taking top-level rows into account. Fixed that and relaxed min/max width limits -- I think it looks better now.
Comment 9 Andrey Kosyakov 2010-10-25 09:10:34 PDT
Created attachment 71759 [details]
updated screenshot

- Fixed table header/body width inconsistency
- Fixed autosize
Comment 10 Andrey Kosyakov 2010-10-25 09:13:20 PDT
Created attachment 71760 [details]
patch

- Take children into consideration when computing table width
Comment 11 WebKit Review Bot 2010-10-25 09:15:04 PDT
Attachment 71759 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
Total errors found: 0 in 0 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Pavel Feldman 2010-10-25 09:27:13 PDT
Comment on attachment 71760 [details]
patch

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

> WebCore/ChangeLog:64
> +2010-10-25  Andrey Kosyakov  <caseq@chromium.org>

Two changelogs.

> WebCore/WebCore.gypi:4424
> +            'inspector/front-end/ResourceCookiesView.js',

This is a tab, not a view.

> WebCore/inspector/front-end/CookieItemsViewBase.js:33
> +WebInspector.CookieItemsViewBase = function()

This could simply reside in CookieItemsView in form of helper methods / component.

> WebCore/inspector/front-end/CookieParser.js:57
> +                this._addCookie(kv, "request");

Could you use constants for these?

> WebCore/inspector/front-end/DataGrid.js:320
> +        var children = maxDescentLevel ? this._enumerateChildren(this, [], maxDescentLevel) : this.children;

So if I pass "1" as maxDescentLevel, the code will work as if it was "1".

> WebCore/inspector/front-end/DataGrid.js:404
> +        if (!this._columnWidthsInitialized && this.element.enclosingNodeOrSelfWithNodeName("body")) {

You could also check this.element.offsetWidth for === 0.
Comment 13 Alexey Proskuryakov 2010-10-25 09:59:40 PDT
> Provide a tab in resource view with a list of cookies if Cookie/Set-Cookie headers are available.

How is this different from bug 16531?
Comment 14 Andrey Kosyakov 2010-10-25 10:18:23 PDT

*** This bug has been marked as a duplicate of bug 16531 ***