@@ -212,6 +212,7 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
212
212
text: prompt; url: timers-and-user-prompts.html#dom-prompt
213
213
text: remove a browsing context; url: browsers.html#bcg-remove
214
214
text: report an error; url: webappapis.html#report-the-error
215
+ text: resource; url: infrastructure.html#resources
215
216
text: run the animation frame callbacks; url: imagebitmap-and-animations.html#run-the-animation-frame-callbacks
216
217
text: same origin domain; url: browsers.html#same-origin-domain
217
218
text: select an image source from a source set; url: images.html#select-an-image-source-from-a-source-set
@@ -5257,11 +5258,11 @@ To <dfn>deserialize header</dfn> given |protocol header|:
5257
5258
5258
5259
<pre class="cddl local-cddl">
5259
5260
network.Initiator = {
5260
- type: "parser" / "script" / "preflight" / "other" ,
5261
+ type: text ,
5261
5262
? columnNumber: js-uint,
5262
5263
? lineNumber: js-uint,
5264
+ ? url: text,
5263
5265
? stackTrace: script.StackTrace,
5264
- ? request: network.Request
5265
5266
};
5266
5267
</pre>
5267
5268
@@ -5271,40 +5272,41 @@ request.
5271
5272
<div algorithm>
5272
5273
To <dfn>get the initiator</dfn> given |request|:
5273
5274
5274
- 1. Let |request id| be |request|'s [=request id=] .
5275
-
5276
- 1. Let |type| be "<code> other</code> ".
5277
-
5278
- 1. If |request| is a [=CORS-Preflight Request=] , set |type| to
5279
- "<code> preflight</code> ".
5280
-
5281
- 1. TODO: Get the |type|. It's not quite clear how this ought to work; the CDP
5282
- data depends on whether the navigation was kicked off by the parser or by
5283
- script (so e.g. inserting an image from script causes the initiator to be
5284
- "<code> script</code> "), but that doesn't correspond to anything in Fetch.
5275
+ 1. Let |type| be |request|'s [=request/initiator type=] .
5285
5276
5286
5277
1. If |request|'s [=request/initiator type=] is "<code> fetch</code> " or
5287
5278
"<code> xmlhttprequest</code> ":
5288
5279
5289
5280
1. Let |stack trace| be the [=current stack trace=] .
5290
5281
5291
- 1. If |stack trace| has size of 1 or greater, let |line number| be value of the
5292
- <code> lineNumber</code> field in |stack trace|[0] , and let |column number| be
5293
- the value of the <code> columnNumber</code> field in |stack trace|[0] . Otherwise
5294
- let |line number| and |column number| be 0.
5282
+ 1. If |stack trace| has size of 1 or greater:
5283
+
5284
+ 1. Let |url| be value of the <code> url</code> in |stack trace|[0] .
5285
+
5286
+ 1. Let |line number| be value of the <code> lineNumber</code> field in
5287
+ |stack trace|[0] .
5288
+
5289
+ 1. Let |column number| be the value of the <code> columnNumber</code>
5290
+ field in |stack trace|[0] .
5291
+
5292
+ 1. Otherwise:
5293
+
5294
+ 1. Let |stack trace| be null.
5295
+
5296
+ 1. Let |url| be the URL of the [=resource=] that initiated |request|.
5295
5297
5296
- Otherwise, let |stack trace|, | column number|, and |line number| all be null .
5298
+ 1. Let |column number| be the column number within the [=resource=] that initiated |request| .
5297
5299
5298
- TODO: Chrome includes the current parser position as column number / line
5299
- number for parser-inserted resources.
5300
+ 1. Let |line number| be the line number within the [=resource=] that initiated |request|.
5300
5301
5301
- 1. Return a [=/map=] matching the <code> network.Initiator</code> production, with
5302
- the <code> type</code> field set to |type|, the <code> columnNumber</code>
5303
- field set to |column number| if it's not null, or omitted otherwise, the
5304
- <code> lineNumber</code> field set to |line number| if it's not null, or
5305
- omitted otherwise, the <code> stackTrace</code> field set to |stack trace| if
5306
- it's not null, or omitted otherwise, and the <code> request</code> field set
5307
- to |request id|.
5302
+ 1. Return a [=/map=] matching the <code> network.Initiator</code>
5303
+ production, with the <code> type</code> field set to |type|, the
5304
+ <code> columnNumber</code> field set to |column number| if it's not
5305
+ null, or omitted otherwise, the <code> lineNumber</code> field set to
5306
+ |line number| if it's not null, or omitted otherwise, the
5307
+ <code> stackTrace</code> field set to |stack trace| if it's not null,
5308
+ or omitted otherwise, and the <code> url</code> field set to |url| if
5309
+ it's not null, or omitted otherwise.
5308
5310
5309
5311
</div>
5310
5312
0 commit comments