diff --git a/spec.bs b/spec.bs index cf8b504e..24ff365a 100644 --- a/spec.bs +++ b/spec.bs @@ -1222,6 +1222,80 @@ Each {{FencedFrameConfig}} has: 1. Initialize |value|'s [=fencedframeconfig/contentHeight=] to |serialized|.\[[ContentHeight]]. +Note: To help with ease of adoption, +[until 2026](https://github.com/WICG/turtledove/issues/286#issuecomment-1682842636) we will support +the API {{Window/navigator}}.{{Navigator/deprecatedReplaceInURN()}}, which allows you to substitute +macros into the [=fenced frame config/mapped url=] corresponding to a given [=urn uuid=] or +{{FencedFrameConfig}}. + +
+typedef (USVString or FencedFrameConfig) UrnOrConfig;
+
+partial interface Navigator {
+  Promise<undefined> deprecatedReplaceInURN(
+    UrnOrConfig urnOrConfig, record<USVString, USVString> replacements);
+};
+
+ +
+ To substitute macros with an [=ordered map=] with + [=string=] [=map/keys=] and [=string=] [=map/values=] |macros| into a [=string=] |string|, run + these steps: + + 1. TODO: [Spec this](https://github.com/WICG/fenced-frame/issues/116). + Substitute the keys from |macros| with the corresponding values into |string|, and return the + new string. There is no recursive substitution. +
+ +
+ The deprecatedReplaceInURN(|urnOrConfig|, |replacements|) + method steps are: + + 1. Let |urn| be null. + + 1. If |urnOrConfig| is a {{USVString}}, set |urn| to |urnOrConfig|. + + 1. Otherwise, set |urn| to |urnOrConfig|'s [=fencedframeconfig/urn=]. + + 1. If |urn| is TODO invalid, [=exception/throw=] a {{TypeError}}. + + 1. [=map/For each=] |key| → _ of |replacements|: + 1. If |key| does not [=string/start with=] ${ or %%, + [=exception/throw=] a {{TypeError}}. + 1. If |key| does not [=string/end with=] } or %%, + [=exception/throw=] a {{TypeError}}. + + 1. Let |p| be [=a new promise=]. + + 1. Let |global| be [=this=]'s [=relevant global object=]. + + 1. Run the following steps [=in parallel=]: + + 1. Let |mapping| be |global|'s [=associated Document=]'s [=node navigable=]'s + [=navigable/traversable navigable=]'s [=traversable navigable/fenced frame config mapping=]. + + 1. Let |config| be the result of [=fenced frame config mapping/finding a config=] in |mapping| + with |urn|. + + 1. If |config| is failure, [=queue a global task=] on the [=DOM manipulation task source=] + given |global|, to [=resolve=] |p| with {{undefined}}, and abort these steps. + + 1. Let |substitutedUrl| be the result of [=fencedframeutil/substituting macros=] with + |replacements| into |config|'s [=fenced frame config/mapped url=]'s [=mapped url/value=]. + + 1. Set |config|'s [=fenced frame config/mapped url=]'s [=mapped url/value=] to + |substitutedUrl|. + + 1. [=Queue a global task=] on the [=DOM manipulation task source=] given |global|, to + [=resolve=] |p| with {{undefined}}. + + 1. Return |p|. + + + /fenced-frame/deprecated-config-apis.https.html + +
+

The {{Fence}} interface

Several APIs specific to fenced frames are defined on the {{Fence}} interface.