@@ -5252,32 +5252,33 @@ To <dfn>get the initiator</dfn> given |request|:
5252
5252
5253
5253
1. Let |type| be "<code> other</code> ".
5254
5254
5255
+ 1. Let |stack trace|, |url|, |column number|, and |line number| all be null.
5256
+
5255
5257
1. If |request| is a [=CORS-Preflight Request=] , set |type| to
5256
5258
"<code> preflight</code> ".
5257
5259
5258
- 1. Otherwise, if |requests |'s [=parser metadata =] is "<code> not-parser-inserted </code> ",
5259
- set |type| to "<code> script </code> ".
5260
+ 1. Otherwise, if |request |'s [=request/initiator type =] is "<code> script </code> "
5261
+ and |request| is [=isTopLevel=] , set |type| to "<code> parser </code> ".
5260
5262
5261
- 1. Otherwise, if |requests |'s [=parser metadata =] is "<code> parser-inserted </code> ",
5263
+ 1. Otherwise, if |request |'s [=request/initiator type =] is "<code> css </code> ",
5262
5264
set |type| to "<code> parser</code> ".
5263
5265
5264
- 1. If |type| is "<code> script</code> ":
5265
-
5266
- 1. Let |stack trace| be the [=current stack trace=] .
5266
+ 1. Otherwise, if |request|'s [=request/initiator type=] is "<code> script</code> "
5267
+ and |request| is not [=isTopLevel=] , set |type| to "<code> script</code> ".
5267
5268
5268
- 1. Let |url| be value of the <code> url</code> in |stack trace|[0] .
5269
+ 1. If |request|'s [=request/referrer=] is a URL,
5270
+ set |url| to |request|'s [=request/referrer=] otherwise set |url| to |request|' s document URL;
5269
5271
5270
- 1. Let |line number| be value of the <code> lineNumber </code> field in
5271
- |stack trace| [0] .
5272
+ 1. If |type| is " <code> script </code> " or |request|'s [=request/initiator type=] is " <code> fetch </code> " or
5273
+ " <code> xmlhttprequest </code> ":
5272
5274
5273
- 1. Let |column number| be the value of the <code> columnNumber</code>
5274
- field in |stack trace|[0] .
5275
+ 1. Set |stack trace| be the [=current stack trace=] .
5275
5276
5276
- 1. Otherwise, if |type| is "<code> parser</code> ":
5277
+ 1. Otherwise, if |type| is "<code> parser</code> " and implementation defined parser state is available :
5277
5278
5278
- 1. TODO: set url/ line/column based on the parser positions .
5279
+ 1. Set | line number| to be zero- based parser line position when the |request| started .
5279
5280
5280
- 1. Otherwise, let |stack trace|, | column number|, and |line number| all be null .
5281
+ 1. Set | column number| to be zero-based parser column position when the |request| started .
5281
5282
5282
5283
1. Return a [=/map=] matching the <code> network.Initiator</code>
5283
5284
production, with the <code> type</code> field set to |type|, the
0 commit comments