Re: [w3c/clipboard-apis] Add comprehensive clipboardchange event specification with ClipboardChangeEventInit dictionary (PR #239)

@roraja commented on this pull request.



> +    1. Set <var>document</var>'s <dfn for="Document">clipboardchange pending flag</dfn> to true.
+
+   </div>
+
+   <div class="algorithm" data-algorithm="document-focus-steps">
+   <h5 id="h-document-focus-steps">Document focus steps</h5>
+
+   When a {{Document}} <var>document</var> gains [=system focus=]:
+
+   1. If <var>document</var>'s [=Document/clipboardchange pending flag=] is true:
+    1. Set <var>document</var>'s [=Document/clipboardchange pending flag=] to false.
+    2. Let <var>types</var> be a list of [=mandatory data types=] available on the [=system clipboard=].
+    3. Let <var>changeId</var> be a unique identifier for this clipboard change, generated according to the steps defined in <a href="#h-changeid-generation">ChangeId Generation</a>.
+    4. Let <var>eventInit</var> be a new {{ClipboardChangeEventInit}} dictionary with its {{ClipboardChangeEventInit/types}} member set to <var>types</var> and its {{ClipboardChangeEventInit/changeId}} member set to <var>changeId</var>.
+    5. Let <var>global</var> be <var>document</var>'s [=relevant global object=].
+    6. [=Fire an event=] named {{GlobalEventHandlers/clipboardchange}} at <var>global</var>, using {{ClipboardChangeEvent}}, with <var>eventInit</var>.

I have added a section for this, thanks for the suggestion.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/pull/239#discussion_r2393971191
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/clipboard-apis/pull/239/review/3288274968@github.com>

Received on Wednesday, 1 October 2025 09:26:53 UTC