From 9c053598b1c07ad7961ee9419173279014ff0403 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 14 Nov 2024 15:53:12 +0000 Subject: [PATCH] Deprecate the type field on Network.Initiator This marks the field as optional and no longer sets it, so the CDDL continues to match existing implementations, but it's no longer required to set it. --- index.bs | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/index.bs b/index.bs index e3c5e7a8..10a0e4c8 100644 --- a/index.bs +++ b/index.bs @@ -5767,32 +5767,28 @@ To deserialize header given |protocol header|:
 network.Initiator = {
-    type: "parser" / "script" / "preflight" / "other",
     ? columnNumber: js-uint,
     ? lineNumber: js-uint,
     ? stackTrace: script.StackTrace,
-    ? request: network.Request
+    ? request: network.Request,
+    ? type: "parser" / "script" / "preflight" / "other"
 };
 
The network.Initiator type represents the source of a network request. +Note: The type field is included in the definition for backwards +compatibility, but is no longer set by the [=get the initiator=] steps, and will +be removed in a future revision of this specification. Its use is expected to be +replaced by initiatorType and destination on +network.RequestData. +
To get the initiator given |request|: 1. Let |request id| be |request|'s [=request id=]. -1. Let |type| be "other". - -1. If |request| is a [=CORS-Preflight Request=], set |type| to - "preflight". - -1. TODO: Get the |type|. It's not quite clear how this ought to work; the CDP - data depends on whether the navigation was kicked off by the parser or by - script (so e.g. inserting an image from script causes the initiator to be - "script"), but that doesn't correspond to anything in Fetch. - 1. If |request|'s [=request/initiator type=] is "fetch" or "xmlhttprequest": @@ -5808,13 +5804,12 @@ To get the initiator given |request|: TODO: Chrome includes the current parser position as column number / line number for parser-inserted resources. -1. Return a [=/map=] matching the network.Initiator production, with - the type field set to |type|, the columnNumber - field set to |column number| if it's not null, or omitted otherwise, the - lineNumber field set to |line number| if it's not null, or - omitted otherwise, the stackTrace field set to |stack trace| if - it's not null, or omitted otherwise, and the request field set - to |request id|. +1. Return a [=/map=] matching the network.Initiator production, the + columnNumber field set to |column number| if it's not null, or + omitted otherwise, the lineNumber field set to |line number| if + it's not null, or omitted otherwise, the stackTrace field set to + |stack trace| if it's not null, or omitted otherwise, and the + request field set to |request id|.