-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add supports API for async clipboard. #192
Conversation
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
@garykac could you ptal? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the mandatory data types, should this API also return true for correctly-prefixed custom formats?
@evanstade @garykac Note that this feature (including the API shape) was approved by EditingWG already. |
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
SHA: 4db562e Reason: push, by snianu Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
I think the exact wording and behavior here still warrant discussion even though the EditingWG approved the general idea of it (?) 1.5 years ago. Specifically, which of the following should return true if web custom formats are supported, and why?
|
@evanstade Per the web custom format proposal, web custom formats are arbitrary types that are denoted by the prefix "web " ("web" followed by U+0020 SPACE) to distinguish them from built-in types, so we only need to check for the web prefix. The custom MIME type is specified by the web author at the time of ClipboardItem object creation which is when we validate the |
In the original request for And I think that makes more sense. What is the purpose of any of the text after "web"? It has no bearing on the returned value. |
I didn't notice that the proposal doesn't have a space after |
I don't think that Either way, the proposal is for an exact string match on |
I was referring to this definition of MIME type which is what we use in the clipboard spec. IMO removing the space from the Anyways, I don't have a strong opinion on this so I'm adding Agenda+ label to discuss with the EditingWG members. |
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
Note that currently web authors already use |
If you are given a string and you have to figure out whether it represents a web custom type, then sure, use I'd be interested in hearing opinions from folks with long-term spec-writing experience such as @inexorabletash |
I don't have strong feelings here, but my intuition for how developers would try to use supports() for custom types in practice is either:
The former aligns with the concept of supports() being a way of testing what the ClipboardItem constructor would do without wasting time, but accepting 'web' on its own seems like a nice to have. 'web ' (web + space, with no suffix) on its own isn't accepted by https://w3c.github.io/clipboard-apis/#dom-clipboarditem-clipboarditem so far as I can tell (maybe I'm wrong?), and it's not intuitive to me that a developer would try it. But maybe I'm missing the point of the discussion. What are the alternatives we're considering? |
I like this proposal as it also matches with how we parse the web custom format during the |
I'm happy with #192 (comment), it extends #170 (comment) in a very logical way. |
I suppose it is the case that the part after
Which of these should return true? The reason I questioned the utility of |
The Web Editing Working Group just discussed
The full IRC log of that discussion<dandclark> topic: Add supports API for async clipboard.<dandclark> github: https://github.com//pull/192 <dandclark> snianu: Supports API that was proposed some years ago, was proposed to feature detect in async clipboard API. So can determine if format is supported or not. <dandclark> snianu: We had consensus in the WG that it's a good addition. Had stated need from web devs too. Need to know if given format is supported. Custom formats can be expensive to produce. <dandclark> snianu: Leads to unnecessary work otherwise, to generate unsupported formts. <dandclark> snianu: In this issue, proposal is for web custom formats, instead of just providing web prefix the author has to provide entire MIME type, web prefix and suffix. <dandclark> snianu: If it's a valid format with 'web ' prefix, return true, else false. <dandclark> snianu: Was some confusion with web custom formats we require the 'web ' prefix. Without the space it's invalid MIME type. <dandclark> snianu: We strip out the 'web ' prefix and parse the MIME type to see if it's valid MIME type. Proposal is to let authors provide the entire format with the 'web ' prefix <dandclark> snianu: 'web' and 'web ' (witth space) might be convenient to authors, but if they provide invalid MIME that it fails. So is better to require entire name, as 'web MIMEtype'. Ensures that format is valid and write will succeed. <dandclark> johanneswilm: No comments from other implementers, what's this mean? <dandclark> whsieh: Seems fine to me <dandclark> johanneswilm: Can we resolve or is this controversial? <dandclark> snianu: It's straightforward. We will make the change that authors have to provide the full custom format with 'web ' (with space) prefix, and MIME type suffix. <dandclark> RESOLVED: make the change that authors have to provide the full custom format with 'web ' (with space) prefix, and MIME type suffix. |
The PR for the resolution is #195 |
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Anupam Snigdha <[email protected]> Reviewed-by: Evan Stade <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214477}
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Anupam Snigdha <[email protected]> Reviewed-by: Evan Stade <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214477}
In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Anupam Snigdha <[email protected]> Reviewed-by: Evan Stade <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214477}
…d to async clipboard API., a=testonly Automatic update from web-platform-tests [Async Clipboard API] Add supports method to async clipboard API. In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Anupam Snigdha <[email protected]> Reviewed-by: Evan Stade <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214477} -- wpt-commits: d1bd5741a6ec790fbec6e6d69158178d26f65269 wpt-pr: 41993
…d to async clipboard API., a=testonly Automatic update from web-platform-tests [Async Clipboard API] Add supports method to async clipboard API. In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <[email protected]> Commit-Queue: Anupam Snigdha <[email protected]> Reviewed-by: Evan Stade <[email protected]> Cr-Commit-Position: refs/heads/main@{#1214477} -- wpt-commits: d1bd5741a6ec790fbec6e6d69158178d26f65269 wpt-pr: 41993
…d to async clipboard API., a=testonly Automatic update from web-platform-tests [Async Clipboard API] Add supports method to async clipboard API. In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <tkentchromium.org> Commit-Queue: Anupam Snigdha <snianumicrosoft.com> Reviewed-by: Evan Stade <estadechromium.org> Cr-Commit-Position: refs/heads/main{#1214477} -- wpt-commits: d1bd5741a6ec790fbec6e6d69158178d26f65269 wpt-pr: 41993 UltraBlame original commit: 1603ba63e55624bd159b523ea1c7430df469e647
…d to async clipboard API., a=testonly Automatic update from web-platform-tests [Async Clipboard API] Add supports method to async clipboard API. In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <tkentchromium.org> Commit-Queue: Anupam Snigdha <snianumicrosoft.com> Reviewed-by: Evan Stade <estadechromium.org> Cr-Commit-Position: refs/heads/main{#1214477} -- wpt-commits: d1bd5741a6ec790fbec6e6d69158178d26f65269 wpt-pr: 41993 UltraBlame original commit: 1603ba63e55624bd159b523ea1c7430df469e647
…d to async clipboard API., a=testonly Automatic update from web-platform-tests [Async Clipboard API] Add supports method to async clipboard API. In this change we are adding a new static method `supports` to the ClipboardItem interface to help web authors detect clipboard format types that are supported by Chromium. Github Issue: w3c/clipboard-apis#170 Spec: w3c/clipboard-apis#192 w3c/clipboard-apis#195 I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/pjpN9Lwv5Tk/m/KrAZRbdwAQAJ?utm_medium=email&utm_source=footer&pli=1 Bug: 1483026, 1490635 Change-Id: Ief7c0786833548d2fb51215cefbc39e5930af875 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4865377 Reviewed-by: Kent Tamura <tkentchromium.org> Commit-Queue: Anupam Snigdha <snianumicrosoft.com> Reviewed-by: Evan Stade <estadechromium.org> Cr-Commit-Position: refs/heads/main{#1214477} -- wpt-commits: d1bd5741a6ec790fbec6e6d69158178d26f65269 wpt-pr: 41993 UltraBlame original commit: 1603ba63e55624bd159b523ea1c7430df469e647
Closes #170
For normative changes, the following tasks have been completed:
Implementation commitment:
Preview | Diff