WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
177700
Share more pasteboard code between iOS and macOS and remove dependency on Settings
https://bugs.webkit.org/show_bug.cgi?id=177700
Summary
Share more pasteboard code between iOS and macOS and remove dependency on Set...
Ryosuke Niwa
Reported
2017-09-29 20:21:19 PDT
Now that we've added PasteboardCocoa.mm in
https://trac.webkit.org/r222656
, we can share more code between iOS and macOS. Also, we remove the layering violation inadvertently introduced in
https://trac.webkit.org/r222595
whereby which Pasteboard code depends on Settings.
Attachments
Cleanup
(26.87 KB, patch)
2017-09-29 21:35 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Cleanup
(28.36 KB, patch)
2017-09-29 21:48 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Patch for landing
(29.19 KB, patch)
2017-09-30 01:49 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Patch for landing
(30.49 KB, patch)
2017-09-30 01:58 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Patch for landing
(30.68 KB, patch)
2017-09-30 02:02 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Fixed Mac builds
(30.52 KB, patch)
2017-09-30 02:32 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2017-09-29 21:35:54 PDT
Created
attachment 322277
[details]
Cleanup
Ryosuke Niwa
Comment 2
2017-09-29 21:48:00 PDT
Created
attachment 322279
[details]
Cleanup
Wenson Hsieh
Comment 3
2017-09-29 22:29:11 PDT
Comment on
attachment 322279
[details]
Cleanup View in context:
https://bugs.webkit.org/attachment.cgi?id=322279&action=review
> Source/WebCore/dom/DataTransfer.cpp:146 > + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(type))
Shouldn't this be !Pasteboard::isSafeTypeForDOMToReadAndWrite(normalizedType) here? (instead of the non-normalized type)
Wenson Hsieh
Comment 4
2017-09-29 23:09:36 PDT
(In reply to Wenson Hsieh from
comment #3
)
> Comment on
attachment 322279
[details]
> Cleanup > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=322279&action=review
> > > Source/WebCore/dom/DataTransfer.cpp:146 > > + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(type)) > > Shouldn't this be > !Pasteboard::isSafeTypeForDOMToReadAndWrite(normalizedType) here? (instead > of the non-normalized type)
Let's augment editing/pasteboard/data-transfer-get-data-on-drop-custom.html so that instead of writing "text/plain", we try to write "Text" so that we have test coverage for this codepath where type normalization matters.
Ryosuke Niwa
Comment 5
2017-09-30 01:42:58 PDT
(In reply to Wenson Hsieh from
comment #4
)
> (In reply to Wenson Hsieh from
comment #3
) > > Comment on
attachment 322279
[details]
> > Cleanup > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=322279&action=review
> > > > > Source/WebCore/dom/DataTransfer.cpp:146 > > > + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(type)) > > > > Shouldn't this be > > !Pasteboard::isSafeTypeForDOMToReadAndWrite(normalizedType) here? (instead > > of the non-normalized type) > > Let's augment editing/pasteboard/data-transfer-get-data-on-drop-custom.html > so that instead of writing "text/plain", we try to write "Text" so that we > have test coverage for this codepath where type normalization matters.
That's not going to quite work because this is a bug in getData, not setData. We need to write a new test for this.
Ryosuke Niwa
Comment 6
2017-09-30 01:49:39 PDT
Created
attachment 322288
[details]
Patch for landing
Ryosuke Niwa
Comment 7
2017-09-30 01:49:56 PDT
Comment on
attachment 322288
[details]
Patch for landing Wait for EWS.
Wenson Hsieh
Comment 8
2017-09-30 01:51:09 PDT
(In reply to Ryosuke Niwa from
comment #5
)
> (In reply to Wenson Hsieh from
comment #4
) > > (In reply to Wenson Hsieh from
comment #3
) > > > Comment on
attachment 322279
[details]
> > > Cleanup > > > > > > View in context: > > >
https://bugs.webkit.org/attachment.cgi?id=322279&action=review
> > > > > > > Source/WebCore/dom/DataTransfer.cpp:146 > > > > + if (Settings::customPasteboardDataEnabled() && !Pasteboard::isSafeTypeForDOMToReadAndWrite(type)) > > > > > > Shouldn't this be > > > !Pasteboard::isSafeTypeForDOMToReadAndWrite(normalizedType) here? (instead > > > of the non-normalized type) > > > > Let's augment editing/pasteboard/data-transfer-get-data-on-drop-custom.html > > so that instead of writing "text/plain", we try to write "Text" so that we > > have test coverage for this codepath where type normalization matters. > > That's not going to quite work because this is a bug in getData, not > setData. We need to write a new test for this.
Oh, true. I suppose the new test could exercise both setData/getData with non-normalized versions of text/plain, text/html and text/uri-list and make sure that we can write and read these types from DOM (and also use internals.settings.setCustomPasteboardDataEnabled(true)). I can add this in a followup.
Ryosuke Niwa
Comment 9
2017-09-30 01:52:35 PDT
(In reply to Wenson Hsieh from
comment #8
) >
> I suppose the new test could exercise both setData/getData with > non-normalized versions of text/plain, text/html and text/uri-list and make > sure that we can write and read these types from DOM (and also use > internals.settings.setCustomPasteboardDataEnabled(true)). I can add this in > a followup.
Sure, feel free to write a test if you'd like. If not, I can write one as well.
Ryosuke Niwa
Comment 10
2017-09-30 01:58:09 PDT
Created
attachment 322289
[details]
Patch for landing
Ryosuke Niwa
Comment 11
2017-09-30 01:58:26 PDT
Comment on
attachment 322289
[details]
Patch for landing Wait for EWS (after WPE builds).
Ryosuke Niwa
Comment 12
2017-09-30 02:02:23 PDT
Created
attachment 322290
[details]
Patch for landing
Ryosuke Niwa
Comment 13
2017-09-30 02:02:40 PDT
Comment on
attachment 322290
[details]
Patch for landing Wait for WPE EWS again...
Ryosuke Niwa
Comment 14
2017-09-30 02:32:23 PDT
Created
attachment 322293
[details]
Fixed Mac builds
WebKit Commit Bot
Comment 15
2017-09-30 03:31:08 PDT
Comment on
attachment 322293
[details]
Fixed Mac builds Clearing flags on attachment: 322293 Committed
r222680
: <
http://trac.webkit.org/changeset/222680
>
WebKit Commit Bot
Comment 16
2017-09-30 03:31:10 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 17
2017-09-30 03:34:30 PDT
<
rdar://problem/34754897
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug