Skip to content

Commit

Permalink
Merge with PR 548e7b2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Goto committed Sep 3, 2024
1 parent 931272c commit 8831339
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions spec/login-status.bs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,29 @@ value |value|:

</div>

<!-- ============================================================ -->
# Infrastructure algorithm # {#infra-algorithm}
<!-- ============================================================ -->

<div algorithm>
An [=environment settings object=] (|settings|) is <dfn noexport>same-site with its
ancestors</dfn> if the following algorithm returns `true`:

1. If |settings|'s [=relevant global object=] has no [=associated Document=],
return `false`.
1. Let |document| be |settings|' [=relevant global object=]'s [=associated Document=].
1. If |document| has no [=Document/browsing context=], return `false`.
1. Let |origin| be |settings|' [=environment settings object/origin=].
1. Let |navigable| be |document|'s [=node navigable=].
1. While |navigable| has a non-null [=navigable/parent=]:
1. Set |navigable| to |navigable|'s [=navigable/parent=].
1. If |navigable|'s [=active document=]'s [=Document/origin=] is not
[=/same site=] with |origin|, return `false`.
1. Return `true`.

</div>


<!-- ============================================================ -->
# HTTP header API # {#login-status-http}
<!-- ============================================================ -->
Expand All @@ -84,9 +107,9 @@ process this header as follows:
1. Let |client| be the [=/request=]'s [=request/client=].
1. If the request's [=request/destination=] is not `"document"`:
1. If |client| is null, return.
1. If |origin| is not [=same origin=] with the [=/request=]'s
1. If |origin| is not [=/same site=] with the [=/request=]'s
[=request/origin=], return.
1. If |client| is not [=same-origin with its ancestors=], return.
1. If |client| is not [=same-site with its ancestors=], return.
1. Assert that |value| is a tuple.
1. Let |token| be the first entry of |value|.
1. If |token| is `"logged-in"`, [=set the login status=] for |origin|
Expand Down Expand Up @@ -121,7 +144,7 @@ partial interface Navigator {

<div algorithm="setStatus">
When {{NavigatorLogin/setStatus()}} is called with argument |status|:
1. If the [=current settings object=] is not [=same-origin with its ancestors=],
1. If the [=current settings object=] is not [=same-site with its ancestors=],
throw a {{SecurityError}} {{DOMException}}.
1. Let |origin| be the [=current settings object=]'s
[=environment settings object/origin=].
Expand Down

0 comments on commit 8831339

Please sign in to comment.