WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 177633
[GTK] Move to new Pasteboard API
https://bugs.webkit.org/show_bug.cgi?id=177633
Summary
[GTK] Move to new Pasteboard API
Carlos Alberto Lopez Perez
Reported
2017-09-28 18:23:07 PDT
The tests below fail on WebKitGTK+ since they were added on
r222595
<
https://trac.webkit.org/r222595
> 1) editing/pasteboard/data-transfer-get-data-on-paste-rich-text.html [ Failure ] 2) editing/pasteboard/data-transfer-get-data-on-paste-plain-text.html [ Failure ] 3) editing/pasteboard/data-transfer-get-data-on-paste-custom.html [ Failure ] The text failures: 1)
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r222597%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-rich-text-pretty-diff.html
2)
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r222597%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-plain-text-pretty-diff.html
3)
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r222597%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-custom-pretty-diff.html
Attachments
Patch
(35.24 KB, patch)
2020-05-16 05:11 PDT
,
Carlos Garcia Campos
aperez
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2017-09-28 18:54:46 PDT
(In reply to Carlos Alberto Lopez Perez from
comment #0
)
> The tests below fail on WebKitGTK+ since they were added on
r222595
> <
https://trac.webkit.org/r222595
> > > 1) editing/pasteboard/data-transfer-get-data-on-paste-rich-text.html [ > Failure ] > 2) editing/pasteboard/data-transfer-get-data-on-paste-plain-text.html [ > Failure ] > 3) editing/pasteboard/data-transfer-get-data-on-paste-custom.html [ Failure ] > > The text failures: > > 1) >
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/
>
r222597
%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-rich- > text-pretty-diff.html > 2) >
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/
>
r222597
%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-plain- > text-pretty-diff.html > 3) >
https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/
>
r222597
%20(3376)/editing/pasteboard/data-transfer-get-data-on-paste-custom- > pretty-diff.html
Oh -- the new custom pasteboard data codepaths have only been implemented on Cocoa platforms (iOS, macOS) so far, so this is expected. Is the standard procedure to mark these tests as [ Skip ] or [ Failure ] in GTK platform TestExpectations?
Carlos Alberto Lopez Perez
Comment 2
2017-09-28 18:58:02 PDT
(In reply to Wenson Hsieh from
comment #1
)
> Is the standard procedure to mark these tests as [ Skip ] or [ Failure ] in GTK platform TestExpectations?
Yes. I'm doing that in
bug 177635
Ryosuke Niwa
Comment 3
2017-09-28 19:31:35 PDT
It would be really good for GTK+ to move to new Pasteboard API so that copy/paste drag/drop code would be more maintainable in the long run. I'm hoping to take about at the contributor's meeting as well.
Michael Catanzaro
Comment 4
2017-10-20 11:01:17 PDT
According to Ryosuke, we have to implement: * Pasteboard::typesSafeForBindings() * Pasteboard::writeCustomData(const PasteboardCustomData&) * Pasteboard::readOrigin() * Pasteboard::readStringForCustomData(const String&)
Carlos Garcia Campos
Comment 5
2017-10-24 05:06:40 PDT
Reading the commit message of
r222595
it seems to me the problem is specific to Mac. I don't think we are exposing any private data types of other apps to the web.
Carlos Garcia Campos
Comment 6
2017-10-24 05:19:29 PDT
hmm, I'm now reading
https://www.w3.org/TR/clipboard-apis/
is that spec what the new API implements?
Michael Catanzaro
Comment 7
2017-10-24 07:41:34 PDT
(In reply to Carlos Garcia Campos from
comment #5
)
> Reading the commit message of
r222595
it seems to me the problem is specific > to Mac. I don't think we are exposing any private data types of other apps > to the web.
For the most part, that's right: Mac has tons of weird data in the clipboard that should not be web-exposed, which doesn't happen on Linux. But we probably want to filter out text/uri-list. E.g. if you drag file:///home/mcatanzaro/cats.png into imgur, you want it to see the bytes of the file as image data, you don't want it to actually see file:///home/mcatanzaro/cats.png and learn your private disk layout.
Wenson Hsieh
Comment 8
2017-10-24 07:58:25 PDT
(In reply to Carlos Garcia Campos from
comment #6
)
> hmm, I'm now reading
https://www.w3.org/TR/clipboard-apis/
is that spec what > the new API implements?
The custom pasteboard data codepath primarily ensures that the page is able to supply arbitrary data types using the clipboard APIs (e.g., dataTransfer.setData('myCustomType', 'myCustomData')) without directly affecting the contents of the real platform pasteboard. To do this, we package all the custom pasteboard types and data supplied by web content (as well as some metadata, such as the document origin) into a separate blob of data that we refer to as "custom pasteboard data". On Cocoa platforms, this is written as a separate UTI on the platform pasteboard: "com.apple.WebKit.custom-pasteboard-data". Additionally, by including the origin of the page in the custom pasteboard data, we're able to enforce stricter checks on what data we expose cross-origin through clipboard APIs. For instance,
r223195
uses the custom pasteboard data mechanism to sanitize URLs cross-origin, but maintain original data when dropping/pasting in a page of the same origin.
Michael Catanzaro
Comment 9
2018-02-13 20:19:55 PST
***
Bug 178454
has been marked as a duplicate of this bug. ***
Miguel Gomez
Comment 10
2018-10-18 07:08:06 PDT
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html is crashing since added in
r236785
Miguel Gomez
Comment 11
2018-11-29 07:17:51 PST
There are 2 tests that were passing that are flaky now: editing/pasteboard/paste-text-with-style.html [ Failure Pass ] with diff: --- /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/editing/pasteboard/paste-text-with-style-expected.txt +++ /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/editing/pasteboard/paste-text-with-style-actual.txt @@ -4,7 +4,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > I > B > DIV > BODY > HTML > #document to 9 of #text > FONT > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of #text > I > B > DIV > BODY > HTML > #document to 9 of #text > FONT > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted -EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > FONT > DIV > DIV > BODY > HTML > #document to 9 of #text > FONT > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE +EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > BODY > HTML > #document to 11 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification @@ -26,15 +26,7 @@ " Markup after: -| <b> -| <i> -| "hello bold and italic" -| <div> -| <i> -| "hello italic" -| <div> -| <font> -| color="#ff0000" -| "hello red<#selection-caret>" +| "hello world<#selection-caret>" +| <br> | " " editing/pasteboard/paste-without-nesting.html [ Failure Pass ] with diff --- /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/editing/pasteboard/paste-without-nesting-expected.txt +++ /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/editing/pasteboard/paste-without-nesting-actual.txt @@ -1,7 +1,7 @@ This test checks that copy a selection and paste over the same selection does not create nested divs. PASS confirmedMarkup is 'Hello' -PASS confirmedMarkup is 'Hello<br>world' +FAIL confirmedMarkup should be Hello<br>world. Was Hello. PASS confirmedMarkup is '<div>Hello</div><div>world</div>' PASS confirmedMarkup is '<div>Hello</div><div>world</div>' PASS confirmedMarkup is '<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>'
Carlos Garcia Campos
Comment 12
2020-05-16 02:56:30 PDT
***
Bug 189737
has been marked as a duplicate of this bug. ***
Carlos Garcia Campos
Comment 13
2020-05-16 02:57:40 PDT
***
Bug 81320
has been marked as a duplicate of this bug. ***
Carlos Garcia Campos
Comment 14
2020-05-16 02:59:24 PDT
***
Bug 196541
has been marked as a duplicate of this bug. ***
Carlos Garcia Campos
Comment 15
2020-05-16 05:11:17 PDT
Created
attachment 399547
[details]
Patch
Carlos Garcia Campos
Comment 16
2020-05-17 01:35:48 PDT
Committed
r261792
: <
https://trac.webkit.org/changeset/261792
>
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