Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the "not" condition support #1711

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
RunningStatus runningStatus;

sequence<RouterCondition> _or;
RouterCondition _not;
yoshisatoyanagisawa marked this conversation as resolved.
Show resolved Hide resolved
};

typedef (RouterSourceDict or RouterSourceEnum) RouterSource;
Expand Down Expand Up @@ -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|.
</section>

Expand All @@ -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.
Expand Down
Loading