Skip to content

Commit cc5993e

Browse files
committed
Is parser-inserted metadata close enough?
1 parent a8103b4 commit cc5993e

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
@@ -5236,7 +5236,7 @@ To <dfn>deserialize header</dfn> given |protocol header|:
52365236

52375237
<pre class="cddl local-cddl">
52385238
network.Initiator = {
5239-
type: text,
5239+
type: "parser" / "script" / "preflight" / "other",
52405240
? columnNumber: js-uint,
52415241
? lineNumber: js-uint,
52425242
? url: text,
@@ -5250,32 +5250,34 @@ request.
52505250
<div algorithm>
52515251
To <dfn>get the initiator</dfn> given |request|:
52525252

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

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

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

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

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

5264-
1. Let |line number| be value of the <code>lineNumber</code> field in
5265-
|stack trace|[0].
5266+
1. Let |stack trace| be the [=current stack trace=].
52665267

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

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

5272-
1. Let |stack trace| be null.
5273+
1. Let |column number| be the value of the <code>columnNumber</code>
5274+
field in |stack trace|[0].
52735275

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

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

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

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

0 commit comments

Comments
 (0)