Skip to content

Commit 2dd66fc

Browse files
committed
initiator steps
1 parent cc5993e commit 2dd66fc

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

index.bs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5252,32 +5252,33 @@ To <dfn>get the initiator</dfn> given |request|:
52525252

52535253
1. Let |type| be "<code>other</code>".
52545254

5255+
1. Let |stack trace|, |url|, |column number|, and |line number| all be null.
5256+
52555257
1. If |request| is a [=CORS-Preflight Request=], set |type| to
52565258
"<code>preflight</code>".
52575259

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>".
52605262

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>",
52625264
set |type| to "<code>parser</code>".
52635265

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>".
52675268

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;
52695271

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>":
52725274

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=].
52755276

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:
52775278

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.
52795280

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.
52815282

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

0 commit comments

Comments
 (0)