Skip to content

Commit 1e54584

Browse files
committed
Is parser-inserted metadata close enough?
1 parent 126df22 commit 1e54584

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

index.bs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5224,7 +5224,7 @@ To <dfn>deserialize header</dfn> given |protocol header|:
52245224

52255225
<pre class="cddl local-cddl">
52265226
network.Initiator = {
5227-
type: text,
5227+
type: "parser" / "script" / "preflight" / "other",
52285228
? columnNumber: js-uint,
52295229
? lineNumber: js-uint,
52305230
? url: text,
@@ -5238,32 +5238,34 @@ request.
52385238
<div algorithm>
52395239
To <dfn>get the initiator</dfn> given |request|:
52405240

5241-
1. Let |type| be |request|'s [=request/initiator type=].
5241+
1. Let |type| be "<code>other</code>".
52425242

5243-
1. If |request|'s [=request/initiator type=] is "<code>fetch</code>" or
5244-
"<code>xmlhttprequest</code>":
5243+
1. If |request| is a [=CORS-Preflight Request=], set |type| to
5244+
"<code>preflight</code>".
52455245

5246-
1. Let |stack trace| be the [=current stack trace=].
5246+
1. Otherwise, if |requests|'s [=parser metadata=] is "<code>not-parser-inserted</code>",
5247+
set |type| to "<code>script</code>".
52475248

5248-
1. If |stack trace| has size of 1 or greater:
5249+
1. Otherwise, if |requests|'s [=parser metadata=] is "<code>parser-inserted</code>",
5250+
set |type| to "<code>parser</code>".
52495251

5250-
1. Let |url| be value of the <code>url</code> in |stack trace|[0].
5252+
1. If |type| is "<code>script</code>":
52515253

5252-
1. Let |line number| be value of the <code>lineNumber</code> field in
5253-
|stack trace|[0].
5254+
1. Let |stack trace| be the [=current stack trace=].
52545255

5255-
1. Let |column number| be the value of the <code>columnNumber</code>
5256-
field in |stack trace|[0].
5256+
1. Let |url| be value of the <code>url</code> in |stack trace|[0].
52575257

5258-
1. Otherwise:
5258+
1. Let |line number| be value of the <code>lineNumber</code> field in
5259+
|stack trace|[0].
52595260

5260-
1. Let |stack trace| be null.
5261+
1. Let |column number| be the value of the <code>columnNumber</code>
5262+
field in |stack trace|[0].
52615263

5262-
1. Let |url| be the URL of the [=resource=] that initiated |request|.
5264+
1. Otherwise, if |type| is "<code>parser</code>":
52635265

5264-
1. Let |column number| be the column number within the [=resource=] that initiated |request|.
5266+
1. TODO: set url/line/column based on the parser positions.
52655267

5266-
1. Let |line number| be the line number within the [=resource=] that initiated |request|.
5268+
1. Otherwise, let |stack trace|, |column number|, and |line number| all be null.
52675269

52685270
1. Return a [=/map=] matching the <code>network.Initiator</code>
52695271
production, with the <code>type</code> field set to |type|, the

0 commit comments

Comments
 (0)