RESOLVED FIXED 191482
Web Inspector: Cookies table needs copy keyboard shortcut and context menu support
https://bugs.webkit.org/show_bug.cgi?id=191482
Summary Web Inspector: Cookies table needs copy keyboard shortcut and context menu su...
Matt Baker
Reported 2018-11-09 12:41:34 PST
Summary: Cookies table needs copy keyboard shortcut and context menu support. DataGrid supports `handleCopyEvent` and provides "Copy Row" & "Copy Table" context menu items as needed. Table doesn't need to provide this level of support, but at the very least clients need to query column visibility, so the clipboard text can reflect what is shown in the table. CookieStorageContentView can reuse the formatting from tablePopulateCell to generate clipboard text.
Attachments
Patch (7.38 KB, patch)
2018-11-14 16:05 PST, Matt Baker
no flags
Patch (7.38 KB, patch)
2018-11-16 14:39 PST, Matt Baker
no flags
Patch (7.58 KB, patch)
2018-11-25 18:48 PST, Matt Baker
no flags
Radar WebKit Bug Importer
Comment 1 2018-11-09 12:41:53 PST
Matt Baker
Comment 2 2018-11-14 16:05:46 PST
Matt Baker
Comment 3 2018-11-16 14:39:12 PST
Devin Rousso
Comment 4 2018-11-20 21:18:03 PST
Comment on attachment 355127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355127&action=review r-, due to the `emDash` and `zeroWidthSpace` concerns. The logic looks fine. > Source/WebInspectorUI/ChangeLog:20 > + (WI.CookieStorageContentView): NIT: this should go first in the ChangeLog > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:352 > + return values.join("\t"); Is the reason you aren't using a CSV format because some of the `WI.Cookie` values might have commas? In that case, perhaps we should expose this as a cookie string instead (e.g. `${key}=${value}` joined by ";")? > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:368 > + return cookie.domain || emDash; We shouldn't expose `emDash` as clipboard content. That's really just a formatting tool for WebInspector. See (352) for an alternative > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:370 > + return cookie.path || emDash; Ditto (368) > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:376 > + return cookie.secure ? checkmark : zeroWidthSpace; We shouldn't expose `zeroWidthSpace` as clipboard content. That's really just a formatting tool for WebInspector. See (352) for an alternative > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:378 > + return cookie.httpOnly ? checkmark : zeroWidthSpace; Ditto (376) > Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:380 > + return cookie.sameSite === WI.Cookie.SameSiteType.None ? emDash : WI.Cookie.displayNameForSameSiteType(cookie.sameSite); Ditto (368) > Source/WebInspectorUI/UserInterface/Views/Table.js:244 > + return this._columnSpecs.values(); This should probably just call `Array.from` by default. I don't think we ever expose an iterator unless it's via a `Symbol.iterator` function.
Matt Baker
Comment 5 2018-11-25 17:33:52 PST
Comment on attachment 355127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355127&action=review >> Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:352 >> + return values.join("\t"); > > Is the reason you aren't using a CSV format because some of the `WI.Cookie` values might have commas? In that case, perhaps we should expose this as a cookie string instead (e.g. `${key}=${value}` joined by ";")? This matches the original DataGrid behavior. I haven't found many native apps with tables to use for comparison, but the Instruments app (which doesn't allow multiple selection) does use \t to delimit fields. We could always add other copy options if there is a need. >> Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js:368 >> + return cookie.domain || emDash; > > We shouldn't expose `emDash` as clipboard content. That's really just a formatting tool for WebInspector. See (352) for an alternative I'll make the content depend on a `formatForClipboard` flag (or something like that).
Matt Baker
Comment 6 2018-11-25 18:48:06 PST
Joseph Pecoraro
Comment 7 2018-11-27 12:03:43 PST
Comment on attachment 355612 [details] Patch r=me
WebKit Commit Bot
Comment 8 2018-11-27 13:06:59 PST
Comment on attachment 355612 [details] Patch Clearing flags on attachment: 355612 Committed r238569: <https://trac.webkit.org/changeset/238569>
WebKit Commit Bot
Comment 9 2018-11-27 13:07:00 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.