Skip to content

Commit 8d64a5c

Browse files
Implement the "not" condition support (#1711)
* Implement the "not" condition support * Omit unnecessary space * Remove unnecessary '_' from 'not'.
1 parent e89eaed commit 8d64a5c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/index.bs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
15781578
RunningStatus runningStatus;
15791579

15801580
sequence<RouterCondition> _or;
1581+
RouterCondition not;
15811582
};
15821583

15831584
typedef (RouterSourceDict or RouterSourceEnum) RouterSource;
@@ -3394,6 +3395,13 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
33943395
1. For each |orCondition| of |orConditions|:
33953396
1. If running the [=Verify Router Condition=] algorithm with |orCondition| and |serviceWorker| returns false, return false.
33963397
1. Set |hasCondition| to true.
3398+
1. If |condition|["{{RouterCondition/not}}"] [=map/exists=], then:
3399+
1. If |hasCondition| is true, return false.
3400+
3401+
Note: For ease of understanding the router rule, the "not" condition is mutually exclusive with other conditions.
3402+
3403+
1. If running the [=Verify Router Condition=] algorithm with |condition|["{{RouterCondition/not}}"] and |serviceWorker| returns false, return false.
3404+
1. Set |hasCondition| to true.
33973405
1. Return |hasCondition|.
33983406
</section>
33993407

@@ -3413,6 +3421,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
34133421
1. For each |orCondition| of |orConditions|:
34143422
1. If running the [=Match Router Condition=] algorithm with |orCondition|, |serviceWorker| and |request| returns true, then return true.
34153423
1. Return false.
3424+
1. If |condition|["{{RouterCondition/not}}"] [=map/exists=], then:
3425+
1. If running the [=Match Router Condition=] algorithm with |condition|["{{RouterCondition/not}}"], |serviceWorker| and |request| returns true, then return false.
3426+
1. Return true.
34163427
1. Else:
34173428

34183429
Note: The [=Verify Router Condition=] algorithm guarantees that {{RouterCondition/or}} and other conditions are mutual exclusive.

0 commit comments

Comments
 (0)