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

@roraja commented on this pull request.



> +   <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 by applying a partition-specific transformation to a system-level clipboard change identifier, ensuring that different [=partitions=] receive different identifiers for the same clipboard change while maintaining consistency within the same [=partition=].
+    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>.
+
+   </div>
+
+   For documents in nested browsing contexts, the {{GlobalEventHandlers/clipboardchange}} event fires independently in each {{Document}} based on its own focus state. A clipboard change will fire events in all focused documents across the browsing context tree that have [=sticky activation=] or persistent clipboard permissions.

Fixed, thanks

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

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

Received on Tuesday, 16 September 2025 07:56:51 UTC