From 8d64a5c7429c579308dfc9abd04ea59dc8f40bb5 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Wed, 17 Apr 2024 02:32:16 +0900 Subject: [PATCH] Implement the "not" condition support (#1711) * Implement the "not" condition support * Omit unnecessary space * Remove unnecessary '_' from 'not'. --- docs/index.bs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/index.bs b/docs/index.bs index e2283343..ed870d4f 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -1578,6 +1578,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ RunningStatus runningStatus; sequence<RouterCondition> _or; + RouterCondition not; }; typedef (RouterSourceDict or RouterSourceEnum) RouterSource; @@ -3394,6 +3395,13 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 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. + 1. If |condition|["{{RouterCondition/not}}"] [=map/exists=], then: + 1. If |hasCondition| is true, return false. + + Note: For ease of understanding the router rule, the "not" condition is mutually exclusive with other conditions. + + 1. If running the [=Verify Router Condition=] algorithm with |condition|["{{RouterCondition/not}}"] and |serviceWorker| returns false, return false. + 1. Set |hasCondition| to true. 1. Return |hasCondition|. @@ -3413,6 +3421,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. For each |orCondition| of |orConditions|: 1. If running the [=Match Router Condition=] algorithm with |orCondition|, |serviceWorker| and |request| returns true, then return true. 1. Return false. + 1. If |condition|["{{RouterCondition/not}}"] [=map/exists=], then: + 1. If running the [=Match Router Condition=] algorithm with |condition|["{{RouterCondition/not}}"], |serviceWorker| and |request| returns true, then return false. + 1. Return true. 1. Else: Note: The [=Verify Router Condition=] algorithm guarantees that {{RouterCondition/or}} and other conditions are mutual exclusive.