LibWeb: Implement navigator.clipboard.write

This commit is contained in:
Timothy Flynn 2025-05-01 11:48:45 -04:00 committed by Tim Flynn
commit a4e9a27343
Notes: github-actions[bot] 2025-05-02 21:47:22 +00:00
4 changed files with 150 additions and 3 deletions

View file

@ -18,7 +18,8 @@ namespace Web::Clipboard {
constexpr auto WEB_CUSTOM_FORMAT_PREFIX = "web "sv;
inline constexpr Array MANDATORY_DATA_TYPES = {
// https://w3c.github.io/clipboard-apis/#mandatory-data-types
constexpr inline Array MANDATORY_DATA_TYPES = {
"text/plain"sv, "text/html"sv, "image/png"sv
};
@ -45,6 +46,7 @@ public:
Bindings::PresentationStyle presentation_style() const { return m_presentation_style; }
Vector<String> const& types() const { return m_types; }
Vector<Representation> const& representations() const { return m_representations; }
WebIDL::ExceptionOr<GC::Ref<WebIDL::Promise>> get_type(String const& type);