@@ -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
@@ -5219,11 +5220,11 @@ To <dfn>deserialize header</dfn> given |protocol header|:
5219
5220
5220
5221
<pre class="cddl local-cddl">
5221
5222
network.Initiator = {
5222
- type: "parser" / "script" / "preflight" / "other" ,
5223
+ type: text ,
5223
5224
? columnNumber: js-uint,
5224
5225
? lineNumber: js-uint,
5226
+ ? url: text,
5225
5227
? stackTrace: script.StackTrace,
5226
- ? request: network.Request
5227
5228
};
5228
5229
</pre>
5229
5230
@@ -5233,40 +5234,41 @@ request.
5233
5234
<div algorithm>
5234
5235
To <dfn>get the initiator</dfn> given |request|:
5235
5236
5236
- 1. Let |request id| be |request|'s [=request id=] .
5237
-
5238
- 1. Let |type| be "<code> other</code> ".
5239
-
5240
- 1. If |request| is a [=CORS-Preflight Request=] , set |type| to
5241
- "<code> preflight</code> ".
5242
-
5243
- 1. TODO: Get the |type|. It's not quite clear how this ought to work; the CDP
5244
- data depends on whether the navigation was kicked off by the parser or by
5245
- script (so e.g. inserting an image from script causes the initiator to be
5246
- "<code> script</code> "), but that doesn't correspond to anything in Fetch.
5237
+ 1. Let |type| be |request|'s [=request/initiator type=] .
5247
5238
5248
5239
1. If |request|'s [=request/initiator type=] is "<code> fetch</code> " or
5249
5240
"<code> xmlhttprequest</code> ":
5250
5241
5251
5242
1. Let |stack trace| be the [=current stack trace=] .
5252
5243
5253
- 1. If |stack trace| has size of 1 or greater, let |line number| be value of the
5254
- <code> lineNumber</code> field in |stack trace|[0] , and let |column number| be
5255
- the value of the <code> columnNumber</code> field in |stack trace|[0] . Otherwise
5256
- let |line number| and |column number| be 0.
5244
+ 1. If |stack trace| has size of 1 or greater:
5245
+
5246
+ 1. Let |url| be value of the <code> url</code> in |stack trace|[0] .
5247
+
5248
+ 1. Let |line number| be value of the <code> lineNumber</code> field in
5249
+ |stack trace|[0] .
5250
+
5251
+ 1. Let |column number| be the value of the <code> columnNumber</code>
5252
+ field in |stack trace|[0] .
5253
+
5254
+ 1. Otherwise:
5255
+
5256
+ 1. Let |stack trace| be null.
5257
+
5258
+ 1. Let |url| be the URL of the [=resource=] that initiated |request|.
5257
5259
5258
- Otherwise, let |stack trace|, | column number|, and |line number| all be null .
5260
+ 1. Let |column number| be the column number within the [=resource=] that initiated |request| .
5259
5261
5260
- TODO: Chrome includes the current parser position as column number / line
5261
- number for parser-inserted resources.
5262
+ 1. Let |line number| be the line number within the [=resource=] that initiated |request|.
5262
5263
5263
- 1. Return a [=/map=] matching the <code> network.Initiator</code> production, with
5264
- the <code> type</code> field set to |type|, the <code> columnNumber</code>
5265
- field set to |column number| if it's not null, or omitted otherwise, the
5266
- <code> lineNumber</code> field set to |line number| if it's not null, or
5267
- omitted otherwise, the <code> stackTrace</code> field set to |stack trace| if
5268
- it's not null, or omitted otherwise, and the <code> request</code> field set
5269
- to |request id|.
5264
+ 1. Return a [=/map=] matching the <code> network.Initiator</code>
5265
+ production, with the <code> type</code> field set to |type|, the
5266
+ <code> columnNumber</code> field set to |column number| if it's not
5267
+ null, or omitted otherwise, the <code> lineNumber</code> field set to
5268
+ |line number| if it's not null, or omitted otherwise, the
5269
+ <code> stackTrace</code> field set to |stack trace| if it's not null,
5270
+ or omitted otherwise, and the <code> url</code> field set to |url| if
5271
+ it's not null, or omitted otherwise.
5270
5272
5271
5273
</div>
5272
5274
0 commit comments