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

[Clipboard API] Clipboard Web Custom Formats implementation. #34117

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 18, 2022

This patch addresses the changes proposed by the EditingWG[1] and
agreed upon by all browser vendors. We are removing the unsanitized
option, and instead, adding custom format support for MIME types that
have "web " prefix in them.
Added few wpt tests to test these changes.
Below is a summary of the changes in this CL:

  1. Removed unsanitized option from read/write methods.
  2. If the custom format doesn't have a "web " prefix, then clipboard
    read/write fails.
  3. Transient user activation is applicable to all supported formats -
    text/html, text/plain, image/png and web custom formats.
  4. There are two "buckets" of clipboard formats. One for the
    well-known formats and the other for the web custom format. If the
    author doesn't specify the web format explicitly, then they don't
    get access to it. This means, we won't write web custom formats
    for well-known types implicitly if authors have not indicated that
    during the write call via a "web " prefix (e.g. "web text/html").
    Same applies for reading web custom formats for well-known types-
    if there aren't any formats in the web custom format map, then we
    won't return any web custom formats i.e. text/html won't be
    automatically converted into "web text/html".

Spec: w3c/clipboard-apis#175
Explainer: https://github.com/w3c/editing/blob/gh-pages/docs/clipboard-pickling/explainer.md
i2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/Lo7WBM_v_LY/m/LncCKkXeAwAJ
i2s: https://groups.google.com/a/chromium.org/g/blink-dev/c/k2rgX-4Cigc/m/P0RijrpzBAAJ?utm_medium=email&utm_source=footer&pli=1

  1. Github issue: Arbitrary clipboard types  w3c/clipboard-apis#165

Bug: 106449

Change-Id: I86aae6a662089efeede2a01ac87cb698e9646df5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650952
Commit-Queue: Anupam Snigdha <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Austin Sullivan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1011078}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3650952 branch 4 times, most recently from 0cd6de0 to 70b8443 Compare May 23, 2022 16:52
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3650952 branch 6 times, most recently from bf1f8ab to 73f1618 Compare June 6, 2022 15:58
This patch addresses the changes proposed by the EditingWG[1] and
agreed upon by all browser vendors. We are removing the `unsanitized`
option, and instead, adding custom format support for MIME types that
have "web " prefix in them.
Added few wpt tests to test these changes.
Below is a summary of the changes in this CL:
1. Removed `unsanitized` option from read/write methods.
2. If the custom format doesn't have a "web " prefix, then clipboard
   read/write fails.
3. Transient user activation is applicable to all supported formats -
   text/html, text/plain, image/png and web custom formats.
4. There are two "buckets" of clipboard formats. One for the
   well-known formats and the other for the web custom format. If the
   author doesn't specify the web format explicitly, then they don't
   get access to it. This means, we won't write web custom formats
   for well-known types implicitly if authors have not indicated that
   during the write call via a "web " prefix (e.g. "web text/html").
   Same  applies for reading web custom formats for well-known types-
   if there aren't any formats in the web custom format map, then we
   won't return any web custom formats i.e. text/html won't be
   automatically converted into "web text/html".

Spec: w3c/clipboard-apis#175
Explainer: https://github.com/w3c/editing/blob/gh-pages/docs/clipboard-pickling/explainer.md
i2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/Lo7WBM_v_LY/m/LncCKkXeAwAJ
i2s: https://groups.google.com/a/chromium.org/g/blink-dev/c/k2rgX-4Cigc/m/P0RijrpzBAAJ?utm_medium=email&utm_source=footer&pli=1

1. Github issue: w3c/clipboard-apis#165

Bug: 106449

Change-Id: I86aae6a662089efeede2a01ac87cb698e9646df5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650952
Commit-Queue: Anupam Snigdha <[email protected]>
Reviewed-by: Alexander Timin <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Austin Sullivan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1011078}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3650952 branch from 73f1618 to 6e1219f Compare June 6, 2022 18:01
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit b8ebea7 into master Jun 6, 2022
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-3650952 branch June 6, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants