From a96e39ccd50b86d5cbfdc9b77deaec3a2cf79438 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 18 Apr 2023 19:51:46 +0000 Subject: [PATCH 1/4] update idl + references --- spec.bs | 64 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/spec.bs b/spec.bs index 6c52ca21..c5c3a920 100644 --- a/spec.bs +++ b/spec.bs @@ -691,6 +691,7 @@ A fenced frame config instance is a struct with the following One major input to the <{fencedframe}> element is the {{FencedFrameConfig}} interface, which maps to an internal [=fenced frame config=] [=struct=]. +TODO: Specify the "internal" fields in the right way.
   enum OpaqueProperty {"opaque"};
 
@@ -699,11 +700,14 @@ maps to an internal [=fenced frame config=] [=struct=].
 
   [Exposed=Window]
   interface FencedFrameConfig {
-    constructor(USVString url);
+    readonly attribute USVString urn;
+    readonly attribute object config;
 
     readonly attribute FencedFrameConfigURL? url;
-    readonly attribute FencedFrameConfigSize? width;
-    readonly attribute FencedFrameConfigSize? height;
+    readonly attribute FencedFrameConfigSize? containerWidth;
+    readonly attribute FencedFrameConfigSize? containerHeight;
+    readonly attribute FencedFrameConfigSize? contentWidth;
+    readonly attribute FencedFrameConfigSize? contentHeight;
 
     undefined setSharedStorageContext(DOMString contextString);
   };
@@ -711,6 +715,8 @@ maps to an internal [=fenced frame config=] [=struct=].
 
 Issue: Fix the "indistinguishable" IDL bug with the unions above.
 
+Each {{FencedFrameConfig}} has two internal members: {{FencedFrameConfig/urn}}, which is a [=urn uuid=], and {{FencedFrameConfig/config}}, which is a [=fenced frame config=].
+
 Each {{FencedFrameConfig}} has a url, which is a [=URL=].
 
 1. TODO: add more fields to {{FencedFrameConfig}}
@@ -718,25 +724,49 @@ Each {{FencedFrameConfig}} has a url, which is
 
The {{FencedFrameConfig/url}} IDL attribute getter steps are: - 1. TODO + 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/mapped url=]'s + [=mapped url/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ + mapped url=]'s [=mapped url/value=]. + + 1. Otherwise, return `"opaque"`.
-
- The {{FencedFrameConfig/width}} IDL attribute getter steps are: +
+ The {{FencedFrameConfig/containerWidth}} IDL attribute getter steps are: - 1. TODO + 1. Return {{FencedFrameConfig/config}}'s [=fenced frame config/container size=]'s [=size/width=].
-
- The {{FencedFrameConfig/height}} IDL attribute getter steps are: +
+ The {{FencedFrameConfig/containerHeight}} IDL attribute getter steps are: - 1. TODO + 1. Return {{FencedFrameConfig/config}}'s [=fenced frame config/container size=]'s [=size/height=]. +
+ +
+ The {{FencedFrameConfig/contentWidth}} IDL attribute getter steps are: + + 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/content size=]'s + [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ + content size=]'s [=content size/value=]'s [=size/width=]. + + 1. Otherwise, return `"opaque"`. +
+ +
+ The {{FencedFrameConfig/contentHeight}} IDL attribute getter steps are: + + 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/content size=]'s + [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ + content size=]'s [=content size/value=]'s [=size/height=]. + + 1. Otherwise, return `"opaque"`.
- The setSharedStorageContext(contextString) method steps are: + The setSharedStorageContext(|contextString|) method steps are: - 1. TODO + 1. Set {{FencedFrameConfig/config}}'s [=fenced frame config/embedder shared storage context=] to |contextString|.

The {{Fence}} interface

@@ -769,7 +799,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
- The reportEvent(event) method steps are: + The reportEvent(|event|) method steps are: 1. Let |instance| be [=this=]'s [=relevant global object=]'s [=associated Document=]'s [=node navigable=]'s [=navigable/traversable navigable=]'s [=fenced frame config instance=]. @@ -793,7 +823,7 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface.
- The setReportEventDataForAutomaticBeacons(event) + The setReportEventDataForAutomaticBeacons(|event|) method steps are: 1. Let |instance| be [=this=]'s [=relevant global object=]'s [=associated Document=]'s [=node @@ -807,7 +837,7 @@ 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. Run [=set automatic beacon data=] with event and |instance|'s + 1. Run [=set automatic beacon data=] with |event| and |instance|'s [=fenced frame config instance/fenced frame reporter=].
@@ -830,7 +860,9 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. [=map/For each=] |urn| → |config| of |instance|'s [=fenced frame config instance/nested configs=]: - 1. TODO: construct a {{FencedFrameConfig}} from |config| and |urn|. + 1. [=list/Extend=] |results| with a {{FencedFrameConfig}} where {{FencedFrameConfig/urn}} is + |urn| and {{FencedFrameConfig/config}} is |config|. + TODO: phrase the constructor correctly. 1. Return |results|. From 9d6da15abcb09f78968828c962151a2dfc336253 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 18 Apr 2023 20:54:00 +0000 Subject: [PATCH 2/4] fix up --- spec.bs | 65 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/spec.bs b/spec.bs index c5c3a920..5ada7f4e 100644 --- a/spec.bs +++ b/spec.bs @@ -285,12 +285,14 @@ Each <{fencedframe}> has a config, which is either a 1. Let |url| be the [=URL record=] about:blank. 1. Parse |element|'s [=fencedframe/config=]'s - [=fencedframeconfig/url=] relative to |element|'s [=Node/node document=]. If this is - successful, then set [=url=] to the resulting URL record. + [=fencedframeconfig/config=]'s [=fenced frame config/mapped url=]'s [=mapped url/value=] + relative to |element|'s [=Node/node document=]. If this is successful, then set [=url=] to the + resulting URL record. 1. [=Navigate=] |element|'s [=fenced navigable container/fenced navigable=] to |url| using |element|'s [=Node/node document=], with [=historyHandling=] set to "`replace`" , and [=referrerPolicy=] set to "`no-referrer`". + TODO: generate and store the config instance
@@ -578,7 +580,7 @@ A fenced frame config is a struct with the following [=struct/ : nested configs :: null, or a struct with the following fields: : value - :: a sequence of [=fenced frame configs=] + :: a [=list=] of [=fenced frame configs=] : visibility :: a [=visibility=] @@ -674,10 +676,18 @@ A fenced frame config instance is a struct with the following :: 1. If |config|'s [=fenced frame config/nested configs=] is null, set to null. - 1. Otherwise, set to an [=ordered map=], where for each [=fenced frame config=] in - |config|'s [=fenced frame config/nested configs=]'s [=nested configs/value=], there is - an entry where the key is a randomly sampled [=urn uuid=] and the value is the [=fenced - frame config=]. TODO: Write this in the proper syntax + 1. Otherwise: + + 1. Let |results| be an empty [=ordered map=]. + + 1. [=list/For each=] |nested config| of |config|'s [=fenced frame config/nested + configs=]'s [=nested configs/value=]: + + 1. Let |urn| be a random, unique [=urn uuid=]. + + 1. [=map/Set=] |results|[|urn|] to |nested config|. + + 1. Set [=fenced frame config instance/nested configs=] to |results|. : [=fenced frame config instance/partition nonce=] :: a random, unique [=partition nonce=] @@ -691,7 +701,6 @@ A fenced frame config instance is a struct with the following One major input to the <{fencedframe}> element is the {{FencedFrameConfig}} interface, which maps to an internal [=fenced frame config=] [=struct=]. -TODO: Specify the "internal" fields in the right way.
   enum OpaqueProperty {"opaque"};
 
@@ -700,9 +709,6 @@ maps to an internal [=fenced frame config=] [=struct=].
 
   [Exposed=Window]
   interface FencedFrameConfig {
-    readonly attribute USVString urn;
-    readonly attribute object config;
-
     readonly attribute FencedFrameConfigURL? url;
     readonly attribute FencedFrameConfigSize? containerWidth;
     readonly attribute FencedFrameConfigSize? containerHeight;
@@ -715,16 +721,14 @@ maps to an internal [=fenced frame config=] [=struct=].
 
 Issue: Fix the "indistinguishable" IDL bug with the unions above.
 
-Each {{FencedFrameConfig}} has two internal members: {{FencedFrameConfig/urn}}, which is a [=urn uuid=], and {{FencedFrameConfig/config}}, which is a [=fenced frame config=].
-
-Each {{FencedFrameConfig}} has a url, which is a [=URL=].
+Each {{FencedFrameConfig}} has two internal members: urn, which is a [=urn uuid=], and config, which is a [=fenced frame config=].
 
-1. TODO: add more fields to {{FencedFrameConfig}}
+TODO: add more fields to {{FencedFrameConfig}}
 
 
The {{FencedFrameConfig/url}} IDL attribute getter steps are: - 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/mapped url=]'s + 1. If {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/mapped url=]'s [=mapped url/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ mapped url=]'s [=mapped url/value=]. @@ -734,21 +738,23 @@ Each {{FencedFrameConfig}} has a url, which is
The {{FencedFrameConfig/containerWidth}} IDL attribute getter steps are: - 1. Return {{FencedFrameConfig/config}}'s [=fenced frame config/container size=]'s [=size/width=]. + 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + container size=]'s [=size/width=].
The {{FencedFrameConfig/containerHeight}} IDL attribute getter steps are: - 1. Return {{FencedFrameConfig/config}}'s [=fenced frame config/container size=]'s [=size/height=]. + 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + container size=]'s [=size/height=].
The {{FencedFrameConfig/contentWidth}} IDL attribute getter steps are: - 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/content size=]'s - [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ - content size=]'s [=content size/value=]'s [=size/width=]. + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content + size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame + config/content size=]'s [=content size/value=]'s [=size/width=]. 1. Otherwise, return `"opaque"`.
@@ -756,17 +762,19 @@ Each {{FencedFrameConfig}} has a url, which is
The {{FencedFrameConfig/contentHeight}} IDL attribute getter steps are: - 1. If {{FencedFrameConfig/config}}'s [=fenced frame config/content size=]'s - [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/ - content size=]'s [=content size/value=]'s [=size/height=]. + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content + size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame + config/content size=]'s [=content size/value=]'s [=size/height=]. 1. Otherwise, return `"opaque"`.
- The setSharedStorageContext(|contextString|) method steps are: + The setSharedStorageContext(|contextString|) method steps + are: - 1. Set {{FencedFrameConfig/config}}'s [=fenced frame config/embedder shared storage context=] to |contextString|. + 1. Set the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/embedder + shared storage context=] to |contextString|.

The {{Fence}} interface

@@ -860,8 +868,9 @@ Several APIs specific to fenced frames are defined on the {{Fence}} interface. 1. [=map/For each=] |urn| → |config| of |instance|'s [=fenced frame config instance/nested configs=]: - 1. [=list/Extend=] |results| with a {{FencedFrameConfig}} where {{FencedFrameConfig/urn}} is - |urn| and {{FencedFrameConfig/config}} is |config|. + 1. [=list/Extend=] |results| with a {{FencedFrameConfig}} where the {{FencedFrameConfig}}'s + [=fencedframeconfig/urn=] is |urn| and the {{FencedFrameConfig}}'s [=fencedframeconfig/ + config=] is |config|. TODO: phrase the constructor correctly. 1. Return |results|. From cbe9d29953914662ee12769919fed7f6c4ff4471 Mon Sep 17 00:00:00 2001 From: Garrett Tanzer Date: Tue, 18 Apr 2023 20:59:34 +0000 Subject: [PATCH 3/4] make getters nullable --- spec.bs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec.bs b/spec.bs index 5ada7f4e..8b92b30b 100644 --- a/spec.bs +++ b/spec.bs @@ -738,6 +738,9 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/containerWidth}} IDL attribute getter steps are: + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + container size=] is null, return null. + 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ container size=]'s [=size/width=].
@@ -745,6 +748,9 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/containerHeight}} IDL attribute getter steps are: + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + container size=] is null, return null. + 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ container size=]'s [=size/height=].
@@ -752,6 +758,9 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/contentWidth}} IDL attribute getter steps are: + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + content size=] is null, return null. + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/content size=]'s [=content size/value=]'s [=size/width=]. @@ -762,6 +771,9 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/contentHeight}} IDL attribute getter steps are: + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ + content size=] is null, return null. + 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/content size=]'s [=content size/value=]'s [=size/height=]. From 8b9961e0756fb952977ed81e073ab2816c43ca0b Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Wed, 19 Apr 2023 11:22:36 +0200 Subject: [PATCH 4/4] Use this dfn --- spec.bs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/spec.bs b/spec.bs index 8b92b30b..a37f0cfd 100644 --- a/spec.bs +++ b/spec.bs @@ -738,32 +738,32 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/containerWidth}} IDL attribute getter steps are: - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - container size=] is null, return null. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/container size=] is null, + return null. - 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - container size=]'s [=size/width=]. + 1. Return [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/container size=]'s + [=size/width=].
The {{FencedFrameConfig/containerHeight}} IDL attribute getter steps are: - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - container size=] is null, return null. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/container size=] is null, + return null. - 1. Return the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - container size=]'s [=size/height=]. + 1. Return [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/container size=]'s + [=size/height=].
The {{FencedFrameConfig/contentWidth}} IDL attribute getter steps are: - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - content size=] is null, return null. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=] is null, + return null. - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content - size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame - config/content size=]'s [=content size/value=]'s [=size/width=]. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=]'s [=content + size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/content + size=]'s [=content size/value=]'s [=size/width=]. 1. Otherwise, return `"opaque"`.
@@ -771,12 +771,12 @@ Each {{FencedFrameConfig}} has two internal members:
The {{FencedFrameConfig/contentHeight}} IDL attribute getter steps are: - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/ - content size=] is null, return null. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=] is null, + return null. - 1. If the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/content - size=]'s [=content size/visibility=] is [=visibility/transparent=], return the [=fenced frame - config/content size=]'s [=content size/value=]'s [=size/height=]. + 1. If [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/content size=]'s [=content + size/visibility=] is [=visibility/transparent=], return the [=fenced frame config/content + size=]'s [=content size/value=]'s [=size/height=]. 1. Otherwise, return `"opaque"`.
@@ -785,8 +785,8 @@ Each {{FencedFrameConfig}} has two internal members: The setSharedStorageContext(|contextString|) method steps are: - 1. Set the {{FencedFrameConfig}}'s [=fencedframeconfig/config=]'s [=fenced frame config/embedder - shared storage context=] to |contextString|. + 1. Set [=this=]'s [=fencedframeconfig/config=]'s [=fenced frame config/embedder shared storage + context=] to |contextString|.

The {{Fence}} interface