From 9f380a11b89bf6809d9ac0e8d1362710825e7917 Mon Sep 17 00:00:00 2001 From: Shunya Shishido Date: Thu, 30 Jan 2025 13:59:03 +0900 Subject: [PATCH] Define 1024 as a upper limit of total registered router rules --- docs/index.bs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/index.bs b/docs/index.bs index 6020235c..0a280725 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -212,6 +212,10 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ A [=/service worker=] has an associated list of router rules (a [=list=] of {{RouterRule}}s). It is initially an empty [=list=]. + A [=/service worker=] has an associated router rule count (the number of registered {{RouterRule}}s). It is initially set to zero. + + Note: [=router rule count=] is defined as the limit of the total number of registered router rules. This prevents the user agent from spending much resources by evaluating too many router rules. The limit is 1024. + A [=/service worker=] is said to be running if its [=event loop=] is running.
@@ -3401,9 +3405,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ Note: For ease of understanding the router rule, the "or" condition is mutually exclusive with other conditions. 1. Let |orConditions| be |condition|["{{RouterCondition/_or}}"]. - + Note: To limit the resource usage and a condition evaluation time, |orConditions|'s [=list/size=] can be limited. - + 1. For each |orCondition| of |orConditions|: 1. If running the [=Verify Router Condition=] algorithm with |orCondition| and |serviceWorker| returns false, return false. 1. Set |hasCondition| to true. @@ -3414,6 +3418,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If running the [=Verify Router Condition=] algorithm with |condition|["{{RouterCondition/not}}"] and |serviceWorker| returns false, return false. 1. Set |hasCondition| to true. + 1. If |hasCondition| is true, then: + 1. Increament |serviceWorker|'s [=service worker/router rule count=] by one. + 1. If |serviceWorker|'s [=service worker/router rule count=] exceeds 1024, which is the limit of registered router rules, return false. 1. Return |hasCondition|.