Implement client tracking and messaging for controlled documents.
Scope:
- Track window clients by origin, URL, visibility/focus state where available, and controlling service worker registration.
- Add Clients.matchAll(), Clients.openWindow(), Client.postMessage(), client.url, client.id, and controllerchange events.
- Wire navigator.serviceWorker.controller and message events on documents.
- Reuse structured clone for postMessage between document and service worker contexts.
- Ensure clients.claim() updates eligible clients and dispatches controllerchange.
Acceptance criteria:
- Tests cover matchAll filtering, controller assignment, clients.claim(), document-to-worker and worker-to-document postMessage, and structured clone errors.
- E2E scenario demonstrates a registered active worker receiving a message and replying to the page.
- Behavior remains origin-isolated.