Re: [w3c/ServiceWorker] Skip executing fetch handlers if it is no-op. (PR #1672)

@yoshisatoyanagisawa commented on this pull request.



>            1. Run the <a>responsible event loop</a> specified by |settingsObject| until it is destroyed.
           1. Empty |workerGlobalScope|'s <a>list of active timers</a>.
       1. Wait for |serviceWorker| to be [=running=], or for |startFailed| to be true.
       1. If |startFailed| is true, then return *failure*.
       1. Return |serviceWorker|'s [=start status=].
   </section>
 
+  <section algorithm>
+    <h3 id="no-op-handler-identification-algorithm"><dfn>No-Op Handler identification</dfn></h3>
+
+      : Input
+      :: |serviceWorker|, a [=/service worker=]
+      : Output
+      :: a boolean
+
+      1. If |service worker|'s set of event types to handle does not contain "fetch", then returns false.
+      1. If the callback's function bodies (https://tc39.es/ecma262/#prod-FunctionBody) of all fetch event listener in |service worker| are empty, then the user agent *may* return true.

"event listeners" seems to be already defined.  Do you want to replace all of them with DOM standard's event listener?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1672#discussion_r1109450506
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1672/review/1302902274@github.com>

Received on Friday, 17 February 2023 08:47:47 UTC