-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and stabilize widely supported parts of the Clipboard API
- Loading branch information
Showing
11 changed files
with
66 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
crates/web-sys/src/features/gen_ClipboardPermissionDescriptor.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* | ||
* Clipboard API and events | ||
* Editor’s Draft, 4 June 2024 | ||
* | ||
* The origin of this IDL file is: | ||
* https://w3c.github.io/clipboard-apis/#idl-index | ||
*/ | ||
|
||
partial interface Navigator { | ||
[SecureContext, SameObject] readonly attribute Clipboard clipboard; | ||
}; | ||
|
||
typedef Promise<(DOMString or Blob)> ClipboardItemData; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface ClipboardItem { | ||
constructor(record<DOMString, ClipboardItemData> items, | ||
optional ClipboardItemOptions options = {}); | ||
|
||
readonly attribute PresentationStyle presentationStyle; | ||
readonly attribute FrozenArray<DOMString> types; | ||
|
||
Promise<Blob> getType(DOMString type); | ||
|
||
// Not supported by WebKit | ||
// static boolean supports(DOMString type); | ||
}; | ||
|
||
enum PresentationStyle { "unspecified", "inline", "attachment" }; | ||
|
||
dictionary ClipboardItemOptions { | ||
PresentationStyle presentationStyle = "unspecified"; | ||
}; | ||
|
||
typedef sequence<ClipboardItem> ClipboardItems; | ||
|
||
[SecureContext, Exposed=Window] | ||
interface Clipboard : EventTarget { | ||
Promise<ClipboardItems> read(/* optional ClipboardUnsanitizedFormats formats = {} */); | ||
Promise<DOMString> readText(); | ||
Promise<undefined> write(ClipboardItems data); | ||
Promise<undefined> writeText(DOMString data); | ||
}; | ||
|
||
// There is no consensus by browsers to implement this API. | ||
// See https://github.com/w3c/clipboard-apis/pull/197. | ||
// dictionary ClipboardUnsanitizedFormats { | ||
// sequence<DOMString> unsanitized; | ||
// }; | ||
|
||
// Also Chrome-only | ||
// dictionary ClipboardPermissionDescriptor : PermissionDescriptor { | ||
// boolean allowWithoutGesture = false; | ||
// }; |
Oops, something went wrong.