chrome-devtools-frontend 1.0.1008562 → 1.0.1009019

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  "preLaunchTask": "1-build_Debug",
9
9
  "runtimeExecutable": "/usr/bin/npm",
10
10
  "runtimeArgs": ["run", "unittest"],
11
- "port": 9222,
11
+ "port": 7722,
12
12
  "timeout": 30000,
13
13
  "browserLaunchLocation": "workspace",
14
14
  "outputCapture": "std",
@@ -984,7 +984,6 @@ grd_files_debug_sources = [
984
984
  "front_end/panels/elements/components/queryContainer.css.js",
985
985
  "front_end/panels/elements/components/stylePropertyEditor.css.js",
986
986
  "front_end/panels/elements/computedStyleSidebarPane.css.js",
987
- "front_end/panels/elements/computedStyleWidgetTree.css.js",
988
987
  "front_end/panels/elements/domLinkifier.css.js",
989
988
  "front_end/panels/elements/elementStatePaneWidget.css.js",
990
989
  "front_end/panels/elements/elementsPanel.css.js",
@@ -61,8 +61,8 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
61
61
  Capability.IO | Capability.Media | Capability.Inspector;
62
62
  break;
63
63
  case Type.Worker:
64
- this.#capabilitiesMask =
65
- Capability.JS | Capability.Log | Capability.Network | Capability.Target | Capability.IO | Capability.Media;
64
+ this.#capabilitiesMask = Capability.JS | Capability.Log | Capability.Network | Capability.Target |
65
+ Capability.IO | Capability.Media | Capability.Emulation;
66
66
  break;
67
67
  case Type.Node:
68
68
  this.#capabilitiesMask = Capability.JS;
@@ -183,20 +183,20 @@ ElementsTestRunner.computedStyleWidget = function() {
183
183
 
184
184
  ElementsTestRunner.dumpComputedStyle = async function(doNotAutoExpand, printInnerText) {
185
185
  const computed = ElementsTestRunner.computedStyleWidget();
186
- const treeOutline = computed.propertiesOutline;
187
- const children = treeOutline.rootElement().children();
186
+ const treeOutline = computed.propertiesOutline.querySelector('devtools-tree-outline');
187
+ const children = treeOutline.shadowRoot.querySelector('[role="treeitem"]');
188
188
 
189
189
  for (const treeElement of children) {
190
- const property = computed.propertyByTreeElement.get(treeElement);
191
- if (!property || property.name === 'width' || property.name === 'height') {
190
+ const property = treeElement.querySelector('devtools-computed-style-property')?.shadowRoot;
191
+ const propertyName = text(property?.querySelector('.webkit-css-property'));
192
+ const propertyValue = text(property?.querySelector('.value'));
193
+ if (!property || propertyName === 'width' || propertyName === 'height') {
192
194
  continue;
193
195
  }
194
196
 
195
- const propertyName = text(treeElement.title.querySelector('.webkit-css-property'));
196
- const propertyValue = text(treeElement.title.querySelector('.value'));
197
197
  TestRunner.addResult(`${propertyName}: ${propertyValue};`);
198
198
 
199
- if (doNotAutoExpand && !treeElement.expanded) {
199
+ if (doNotAutoExpand && !treeElement.ariaExpanded) {
200
200
  continue;
201
201
  }
202
202
 
@@ -211,7 +211,7 @@ ElementsTestRunner.dumpComputedStyle = async function(doNotAutoExpand, printInne
211
211
  dumpText += text(trace.querySelector('.value'));
212
212
  dumpText += ' - ';
213
213
  dumpText += text(trace.shadowRoot.querySelector('.trace-selector'));
214
- const link = trace.querySelector('[slot="trace-link"]');
214
+ const link = trace.shadowRoot.querySelector('.trace-link');
215
215
 
216
216
  if (link) {
217
217
  dumpText += ' ' + await extractLinkText(link);
@@ -196,11 +196,13 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
196
196
  return initiatorInfo;
197
197
  }
198
198
 
199
- initiatorInfoForRequest(request: SDK.NetworkRequest.NetworkRequest): InitiatorInfo {
200
- const initiatorInfo = this.initializeInitiatorSymbolIfNeeded(request);
201
- if (initiatorInfo.info) {
202
- return initiatorInfo.info;
203
- }
199
+ static initiatorInfoForRequest(request: SDK.NetworkRequest.NetworkRequest, existingInitiatorData?: InitiatorData):
200
+ InitiatorInfo {
201
+ const initiatorInfo: InitiatorData = existingInitiatorData || {
202
+ info: null,
203
+ chain: null,
204
+ request: undefined,
205
+ };
204
206
 
205
207
  let type = SDK.NetworkRequest.InitiatorType.Other;
206
208
  let url = Platform.DevToolsPath.EmptyUrlString;
@@ -253,11 +255,19 @@ export class NetworkLog extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
253
255
  url = initiator.url as Platform.DevToolsPath.UrlString || Platform.DevToolsPath.EmptyUrlString;
254
256
  }
255
257
  }
256
-
257
258
  initiatorInfo.info = {type, url, lineNumber, columnNumber, scriptId, stack: initiatorStack, initiatorRequest};
258
259
  return initiatorInfo.info;
259
260
  }
260
261
 
262
+ initiatorInfoForRequest(request: SDK.NetworkRequest.NetworkRequest): InitiatorInfo {
263
+ const initiatorInfo = this.initializeInitiatorSymbolIfNeeded(request);
264
+ if (initiatorInfo.info) {
265
+ return initiatorInfo.info;
266
+ }
267
+
268
+ return NetworkLog.initiatorInfoForRequest(request, initiatorInfo);
269
+ }
270
+
261
271
  initiatorGraphForRequest(request: SDK.NetworkRequest.NetworkRequest): InitiatorGraph {
262
272
  const initiated = new Map<SDK.NetworkRequest.NetworkRequest, SDK.NetworkRequest.NetworkRequest>();
263
273
  const networkManager = SDK.NetworkManager.NetworkManager.forRequest(request);
@@ -584,7 +594,7 @@ export type EventTypes = {
584
594
  [Events.RequestUpdated]: SDK.NetworkRequest.NetworkRequest,
585
595
  };
586
596
 
587
- interface InitiatorData {
597
+ export interface InitiatorData {
588
598
  info: InitiatorInfo|null;
589
599
  chain: Set<SDK.NetworkRequest.NetworkRequest>|null;
590
600
  request?: SDK.NetworkRequest.NetworkRequest|null;
@@ -595,7 +605,7 @@ export interface InitiatorGraph {
595
605
  initiated: Map<SDK.NetworkRequest.NetworkRequest, SDK.NetworkRequest.NetworkRequest>;
596
606
  }
597
607
 
598
- interface InitiatorInfo {
608
+ export interface InitiatorInfo {
599
609
  type: SDK.NetworkRequest.InitiatorType;
600
610
  // generally this is a url but can also contain "<anonymous>"
601
611
  url: Platform.DevToolsPath.UrlString;
@@ -51,8 +51,13 @@ const computeScopeTree = async function(functionScope: SDK.DebuggerModel.ScopeCh
51
51
  functionEndLocation.columnNumber);
52
52
  const scopeText = text.extract(scopeRange);
53
53
  const scopeStart = text.toSourceRange(scopeRange).offset;
54
- const prefix = 'function fui';
55
- const scopeTree = await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptScopeTree(prefix + scopeText);
54
+ let prefix = 'function fui';
55
+ let scopeTree = await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptScopeTree(prefix + scopeText);
56
+ if (!scopeTree) {
57
+ // Try to parse the function as an arrow function.
58
+ prefix = 'let fui = ';
59
+ scopeTree = await Formatter.FormatterWorkerPool.formatterWorkerPool().javaScriptScopeTree(prefix + scopeText);
60
+ }
56
61
  if (!scopeTree) {
57
62
  return null;
58
63
  }