Bug 187183

Summary: [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
Product: WebKit Reporter: Aditya Keerthi <pxlcoder>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac   
OS: macOS 10.13   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Aditya Keerthi 2018-06-29 09:45:34 PDT
r210683 prevents file URLs from being copied to the clipboard in unexpected cases.

This behavior should be documented in a test.
Comment 1 Aditya Keerthi 2018-06-29 10:03:12 PDT
Created attachment 343921 [details]
Patch
Comment 2 Aditya Keerthi 2018-06-29 10:34:44 PDT
Created attachment 343922 [details]
Patch
Comment 3 Tim Horton 2018-06-29 10:52:04 PDT
Comment on attachment 343922 [details]
Patch

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

> LayoutTests/TestExpectations:2187
> +webkit.org/b/187183 http/tests/security/pasteboard-file-url.html [ Pass Crash ]

It's expected to crash?!
Comment 4 Aditya Keerthi 2018-06-29 15:42:42 PDT
Created attachment 343954 [details]
Patch
Comment 5 Aditya Keerthi 2018-06-29 15:43:51 PDT
Discussed with Wenson and Tim - we should not crash. Fixed the behavior and added a test.
Comment 6 Radar WebKit Bug Importer 2018-06-29 15:46:49 PDT
<rdar://problem/41656200>
Comment 7 Wenson Hsieh 2018-06-29 15:50:57 PDT
Comment on attachment 343954 [details]
Patch

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

> Tools/WebKitTestRunner/TestOptions.h:75
>      bool hasSameInitializationOptions(const TestOptions& options) const

This will definitely work, but I think it's a bit confusing to have a helper named "hasSameInitializationOptions" if it may return false for two identical TestOptions that both have the runSingly flag.

I think this would be a bit less misleading if we:
- Check that options.runSingly matches in hasSameInitializationOptions
- And also return `!options.runSingly && m_options.hasSameInitializationOptions(options)` from the call site in viewSupportsOptions
Comment 8 Aditya Keerthi 2018-06-29 16:00:11 PDT
Created attachment 343961 [details]
Patch
Comment 9 WebKit Commit Bot 2018-06-29 17:06:32 PDT
Comment on attachment 343961 [details]
Patch

Clearing flags on attachment: 343961

Committed r233379: <https://trac.webkit.org/changeset/233379>
Comment 10 WebKit Commit Bot 2018-06-29 17:06:34 PDT
All reviewed patches have been landed.  Closing bug.