Bug 187183 - [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
Summary: [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-29 09:45 PDT by Aditya Keerthi
Modified: 2018-06-29 17:06 PDT (History)
5 users (show)

See Also:


Attachments
Patch (3.34 KB, patch)
2018-06-29 10:03 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (3.30 KB, patch)
2018-06-29 10:34 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (9.40 KB, patch)
2018-06-29 15:42 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (10.26 KB, patch)
2018-06-29 16:00 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

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