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

Check that document is fully active for window.fence methods #209

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Changes from all 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
31 changes: 21 additions & 10 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,7 @@ Note: A config's [=fencedframeconfig/url=] is only null if a [=fencedframeconfig
{{FencedFrameConfig}} objects are [=serializable objects=]. Their [=serialization steps=], given
|value|, |serialized|, and |forStorage| are:

1. If |forStorage| is true, then throw a {{DataCloneError}} {{DOMException}}.
1. If |forStorage| is true, then [=exception/throw=] a {{DataCloneError}} {{DOMException}}.

1. Set |serialized|.\[[Url]] to |value|'s [=fencedframeconfig/url=].

Expand Down Expand Up @@ -1680,11 +1680,11 @@ partial interface Navigator {
1. Let |instance| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=]'s
[=browsing context/fenced frame config instance=].

1. If |instance| is null, then throw a {{DOMException}}.
1. If |instance| is null, then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}.

1. If [=this=]'s [=relevant settings object=]'s [=environment settings object/origin=] and
|instance|'s [=fenced frame config instance/mapped url=]'s [=url/origin=] are not [=same
origin=], then then throw a {{DOMException}}.
origin=], then then [=exception/throw=] an {{InvalidStateError}} {{DOMException}}.

1. Let |maxAdComponents| be 40.

Expand Down Expand Up @@ -1759,6 +1759,11 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
<div algorithm>
The <dfn method for=Fence>reportEvent(|event|)</dfn> method steps are:

1. Let |document| be [=this=]'s [=relevant global object=]'s [=associated Document=].

1. If |document| is not [=Document/fully active=], then [=exception/throw=] a {{SecurityError}}
{{DOMException}}.

1. Let |instance| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=]'s
[=browsing context/fenced frame config instance=].

Expand All @@ -1768,8 +1773,6 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.

1. If |instance|'s [=fenced frame config instance/fenced frame reporter=] is null, then return.

1. Let |document| be [=this=]'s [=relevant global object=]'s [=associated Document=].

1. Let |request initiator| be [=this=]'s [=relevant settings object=]'s [=environment settings
object/origin=].

Expand Down Expand Up @@ -1867,6 +1870,10 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
<div algorithm>
The <dfn method for=Fence>setReportEventDataForAutomaticBeacons(|event|)</dfn>
method steps are:

1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=Document/fully
active=], then [=exception/throw=] a {{SecurityError}} {{DOMException}}.

1. If |event| does not have a {{FenceEvent/destination}} or |event| does not have a
{{FenceEvent/eventType}}:
1. [=exception/Throw=] a {{TypeError}}.
Expand Down Expand Up @@ -1948,11 +1955,13 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
<div algorithm>
The <dfn method for=Fence>notifyEvent(|event|)</dfn> method steps are:

1. If [=this=]'s {{Document}} is not [=Document/fully active=], then return.
1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=Document/fully
active=], then [=exception/throw=] a {{SecurityError}} {{DOMException}}.

1. Let |navigable| be [=this=]'s [=relevant global object=]'s [=Window/navigable=].

1. If any of the following conditions are met, then throw a {{SecurityError}} {{DOMException}}:
1. If any of the following conditions are met, then [=exception/throw=] a {{SecurityError}}
{{DOMException}}:

* |navigable| is not a [=fenced navigable container/fenced navigable=];

Expand Down Expand Up @@ -1991,11 +2000,13 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.

1. Let |p| be [=a new promise=].

1. Let |context| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=].
1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not [=Document/fully
active=], then [=exception/throw=] a {{SecurityError}} {{DOMException}}.

1. If |context| is null, then throw a {{SecurityError}} {{DOMException}}.
1. Let |instance| be [=this=]'s [=relevant global object=]'s [=Window/browsing context=]'s
[=browsing context/fenced frame config instance=].

1. Let |instance| be |context|'s [=browsing context/fenced frame config instance=].
1. If |instance| is null, then return.

1. If the [=relevant settings object=]'s [=environment settings object/origin=] and
|instance|'s [=fenced frame config instance/mapped url=]'s [=url/origin=] are not [=same
Expand Down