Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is PresentationStyle? #159

Closed
snianu opened this issue Oct 8, 2021 · 4 comments
Closed

What is PresentationStyle? #159

snianu opened this issue Oct 8, 2021 · 4 comments

Comments

@snianu
Copy link
Contributor

snianu commented Oct 8, 2021

I'm working on adding a bit more detail about the ClipboardItem interface in #158. This question came up in the PR review and I wasn't sure what the purpose of presentationStyle member is in ClipboardItem that has unspecified, inline & attachment values. I don't see it being used in Chromium async clipboard API implementation, but I do see Safari using it for something that I don't quite understand. Can someone describe the scenario where it's being used and the description of this member so I can add it to the spec? @whsieh @rniwa

@whsieh
Copy link

whsieh commented Oct 8, 2021

The presentationStyle attribute helps distinguish between "inline" data (e.g. selecting text on a web page and copying), vs. file-like data (e.g. copying a plain text file). This difference is used to provide a hint when writing to the system pasteboard using NSItemProvider on iOS.

@mbrodesser
Copy link

It could help to understand how the pasteboard benefits from that hint and what it makes out of it.

This difference is used to provide a hint when writing to the system pasteboard using NSItemProvider on iOS.

Only when writing to the system clipboard?

@whsieh
Copy link

whsieh commented Oct 8, 2021

It could help to understand how the pasteboard benefits from that hint and what it makes out of it.

Would need to double check — but IIRC on iOS/iPadOS, this distinction allows the Notes app to insert a file attachment when copying a plain text file from the Files app, but insert text inline when copying a selected piece of plain text from another app.

In both cases, the MIME type in the pasteboard would be "text/plain".

This difference is used to provide a hint when writing to the system pasteboard using NSItemProvider on iOS.

Only when writing to the system clipboard?

Both reading and writing.

@snianu
Copy link
Contributor Author

snianu commented Oct 12, 2021

@whsieh Thank you Wenson! I'll add those details to the spec.

@snianu snianu closed this as completed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants