chrome-devtools-frontend 1.0.1024166 → 1.0.1025068

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.
@@ -8951,9 +8951,6 @@
8951
8951
  "panels/security/SecurityPanel.ts | keyExchange": {
8952
8952
  "message": "Key exchange"
8953
8953
  },
8954
- "panels/security/SecurityPanel.ts | keyExchangeGroup": {
8955
- "message": "Key exchange group"
8956
- },
8957
8954
  "panels/security/SecurityPanel.ts | logId": {
8958
8955
  "message": "Log ID"
8959
8956
  },
@@ -8951,9 +8951,6 @@
8951
8951
  "panels/security/SecurityPanel.ts | keyExchange": {
8952
8952
  "message": "K̂éŷ éx̂ćĥán̂ǵê"
8953
8953
  },
8954
- "panels/security/SecurityPanel.ts | keyExchangeGroup": {
8955
- "message": "K̂éŷ éx̂ćĥán̂ǵê ǵr̂óûṕ"
8956
- },
8957
8954
  "panels/security/SecurityPanel.ts | logId": {
8958
8955
  "message": "L̂óĝ ÍD̂"
8959
8956
  },
@@ -25,13 +25,14 @@ export class CSSMatchedStyles {
25
25
  readonly #pseudoDOMCascades: Map<Protocol.DOM.PseudoType, DOMInheritanceCascade>;
26
26
  readonly #customHighlightPseudoDOMCascades: Map<string, DOMInheritanceCascade>;
27
27
  readonly #styleToDOMCascade: Map<CSSStyleDeclaration, DOMInheritanceCascade>;
28
+ readonly #parentLayoutNodeId: Protocol.DOM.NodeId|undefined;
28
29
 
29
30
  constructor(
30
31
  cssModel: CSSModel, node: DOMNode, inlinePayload: Protocol.CSS.CSSStyle|null,
31
32
  attributesPayload: Protocol.CSS.CSSStyle|null, matchedPayload: Protocol.CSS.RuleMatch[],
32
33
  pseudoPayload: Protocol.CSS.PseudoElementMatches[], inheritedPayload: Protocol.CSS.InheritedStyleEntry[],
33
34
  inheritedPseudoPayload: Protocol.CSS.InheritedPseudoElementMatches[],
34
- animationsPayload: Protocol.CSS.CSSKeyframesRule[]) {
35
+ animationsPayload: Protocol.CSS.CSSKeyframesRule[], parentLayoutNodeId: Protocol.DOM.NodeId|undefined) {
35
36
  this.#cssModelInternal = cssModel;
36
37
  this.#nodeInternal = node;
37
38
  this.#addedStyles = new Map();
@@ -40,6 +41,7 @@ export class CSSMatchedStyles {
40
41
  if (animationsPayload) {
41
42
  this.#keyframesInternal = animationsPayload.map(rule => new CSSKeyframesRule(cssModel, rule));
42
43
  }
44
+ this.#parentLayoutNodeId = parentLayoutNodeId;
43
45
 
44
46
  this.#nodeForStyleInternal = new Map();
45
47
  this.#inheritedStyles = new Set();
@@ -411,6 +413,10 @@ export class CSSMatchedStyles {
411
413
  return matchingSelectors.length > 0 && this.queryMatches(rule.style);
412
414
  }
413
415
 
416
+ getParentLayoutNodeId(): Protocol.DOM.NodeId|undefined {
417
+ return this.#parentLayoutNodeId;
418
+ }
419
+
414
420
  getMatchingSelectors(rule: CSSStyleRule): number[] {
415
421
  const node = this.nodeForStyle(rule.style);
416
422
  if (!node || typeof node.id !== 'number') {
@@ -305,7 +305,7 @@ export class CSSModel extends SDKModel<EventTypes> {
305
305
  return new CSSMatchedStyles(
306
306
  this, (node as DOMNode), response.inlineStyle || null, response.attributesStyle || null,
307
307
  response.matchedCSSRules || [], response.pseudoElements || [], response.inherited || [],
308
- response.inheritedPseudoElements || [], response.cssKeyframesRules || []);
308
+ response.inheritedPseudoElements || [], response.cssKeyframesRules || [], response.parentLayoutNodeId);
309
309
  }
310
310
 
311
311
  async getClassNames(styleSheetId: Protocol.CSS.StyleSheetId): Promise<string[]> {
@@ -88,6 +88,8 @@ export class SourceMapV3 {
88
88
  sourceRoot!: Platform.DevToolsPath.UrlString|undefined;
89
89
  names!: string[]|undefined;
90
90
  sourcesContent!: string|undefined;
91
+ // eslint-disable-next-line @typescript-eslint/naming-convention
92
+ x_google_ignoreList!: number[]|undefined;
91
93
  constructor() {
92
94
  }
93
95
  }
@@ -432,6 +434,7 @@ export class TextSourceMap implements SourceMap {
432
434
  private parseSources(sourceMap: SourceMapV3): void {
433
435
  const sourcesList = [];
434
436
  const sourceRoot = sourceMap.sourceRoot || Platform.DevToolsPath.EmptyUrlString;
437
+ const ignoreList = new Set(sourceMap.x_google_ignoreList);
435
438
  for (let i = 0; i < sourceMap.sources.length; ++i) {
436
439
  let href = sourceMap.sources[i];
437
440
  // The source map v3 proposal says to prepend the sourceRoot to the source URL
@@ -453,7 +456,9 @@ export class TextSourceMap implements SourceMap {
453
456
  }
454
457
  sourcesList.push(url);
455
458
  if (!this.#sourceInfos.has(url)) {
456
- this.#sourceInfos.set(url, new TextSourceMap.SourceInfo(source ?? null));
459
+ const content = source ?? null;
460
+ const ignoreListHint = ignoreList.has(i);
461
+ this.#sourceInfos.set(url, new TextSourceMap.SourceInfo(content, ignoreListHint));
457
462
  }
458
463
  }
459
464
  sourceMapToSourceList.set(sourceMap, sourcesList);
@@ -584,6 +589,40 @@ export class TextSourceMap implements SourceMap {
584
589
  }
585
590
  return false;
586
591
  }
592
+
593
+ hasIgnoreListHint(sourceURL: Platform.DevToolsPath.UrlString): boolean {
594
+ return this.#sourceInfos.get(sourceURL)?.ignoreListHint ?? false;
595
+ }
596
+
597
+ /**
598
+ * Returns a list of ranges in the generated script, which are known to be
599
+ * third-party code that should be ignore-listed. Each range is a [begin, end)
600
+ * pair, meaning that code at the beginning location, up to but not including
601
+ * the end location, is known to be third-party code.
602
+ */
603
+ ignoreListRanges(): TextUtils.TextRange.TextRange[] {
604
+ const mappings = this.mappings();
605
+ const ranges = [];
606
+
607
+ let current: TextUtils.TextRange.TextRange|null = null;
608
+
609
+ for (const {sourceURL, lineNumber, columnNumber} of mappings) {
610
+ const ignoreListHint = sourceURL && this.hasIgnoreListHint(sourceURL);
611
+
612
+ if (!current && ignoreListHint) {
613
+ current = TextUtils.TextRange.TextRange.createUnboundedFromLocation(lineNumber, columnNumber);
614
+ ranges.push(current);
615
+ continue;
616
+ }
617
+ if (current && !ignoreListHint) {
618
+ current.endLine = lineNumber;
619
+ current.endColumn = columnNumber;
620
+ current = null;
621
+ }
622
+ }
623
+
624
+ return ranges;
625
+ }
587
626
  }
588
627
 
589
628
  export namespace TextSourceMap {
@@ -620,11 +659,9 @@ export namespace TextSourceMap {
620
659
  }
621
660
 
622
661
  export class SourceInfo {
623
- content: string|null;
624
662
  reverseMappings: number[]|null = null;
625
663
 
626
- constructor(content: string|null) {
627
- this.content = content;
664
+ constructor(public content: string|null, public ignoreListHint: boolean) {
628
665
  }
629
666
  }
630
667
  }
@@ -351,6 +351,10 @@ class FormattedValueNode extends ValueNode {
351
351
  this.#evalOptions = evalOptions;
352
352
  }
353
353
 
354
+ get sourceType(): SourceType {
355
+ return this.#sourceType;
356
+ }
357
+
354
358
  async findProperties(...properties: string[]): Promise<{
355
359
  [x: string]: FormattedValueNode | undefined,
356
360
  }> {
@@ -348,7 +348,7 @@ export class DeprecationIssue extends Issue {
348
348
  break;
349
349
  case Protocol.Audits.DeprecationIssueType.CrossOriginAccessBasedOnDocumentDomain:
350
350
  messageFunction = i18nLazyString(UIStrings.crossOriginAccessBasedOnDocumentDomain);
351
- milestone = 106;
351
+ milestone = 109;
352
352
  break;
353
353
  case Protocol.Audits.DeprecationIssueType.CrossOriginWindowAlert:
354
354
  messageFunction = i18nLazyString(UIStrings.crossOriginWindowApi, {PH1: 'window.alert'});
@@ -367,7 +367,7 @@ export class DeprecationIssue extends Issue {
367
367
  break;
368
368
  case Protocol.Audits.DeprecationIssueType.DocumentDomainSettingWithoutOriginAgentClusterHeader:
369
369
  messageFunction = i18nLazyString(UIStrings.documentDomainSettingWithoutOriginAgentClusterHeader);
370
- milestone = 106;
370
+ milestone = 109;
371
371
  break;
372
372
  case Protocol.Audits.DeprecationIssueType.EventPath:
373
373
  messageFunction = i18nLazyString(UIStrings.eventPath);
@@ -30,6 +30,8 @@
30
30
 
31
31
  import * as Platform from '../../core/platform/platform.js';
32
32
 
33
+ const MAX_SAFE_INT32 = 2 ** 31 - 1;
34
+
33
35
  export interface SerializedTextRange {
34
36
  startLine: number;
35
37
  startColumn: number;
@@ -45,6 +47,10 @@ export class TextRange {
45
47
  return new TextRange(line, column, line, column);
46
48
  }
47
49
 
50
+ static createUnboundedFromLocation(line: number, column: number): TextRange {
51
+ return new TextRange(line, column, MAX_SAFE_INT32, MAX_SAFE_INT32);
52
+ }
53
+
48
54
  static fromObject(serializedTextRange: SerializedTextRange): TextRange {
49
55
  return new TextRange(
50
56
  serializedTextRange.startLine, serializedTextRange.startColumn, serializedTextRange.endLine,
@@ -594,18 +594,17 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
594
594
  }, 200 /* only spin for loading time > 200ms to avoid unpleasant render flashes */);
595
595
  }
596
596
 
597
- const node = this.node();
598
- // TODO: Fetch the parent node id using CDP command
599
- const parentNode = node ? node.parentNode : null;
600
-
601
- const [computedStyles, parentsComputedStyles] =
602
- await Promise.all([this.fetchComputedStylesFor(node), this.fetchComputedStylesFor(parentNode)]);
597
+ const matchedStyles = await this.fetchMatchedCascade();
603
598
 
604
599
  if (signal.aborted) {
605
600
  return;
606
601
  }
607
602
 
608
- const matchedStyles = await this.fetchMatchedCascade();
603
+ const nodeId = this.node()?.id;
604
+ const parentNodeId = matchedStyles?.getParentLayoutNodeId();
605
+
606
+ const [computedStyles, parentsComputedStyles] =
607
+ await Promise.all([this.fetchComputedStylesFor(nodeId), this.fetchComputedStylesFor(parentNodeId)]);
609
608
 
610
609
  if (signal.aborted) {
611
610
  return;
@@ -633,11 +632,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
633
632
  this.dispatchEventToListeners(Events.StylesUpdateCompleted, {hasMatchedStyles: this.hasMatchedStyles});
634
633
  }
635
634
 
636
- private async fetchComputedStylesFor(node: SDK.DOMModel.DOMNode|null): Promise<Map<string, string>|null> {
637
- if (!node) {
635
+ private async fetchComputedStylesFor(nodeId: Protocol.DOM.NodeId|undefined): Promise<Map<string, string>|null> {
636
+ const node = this.node();
637
+ if (node === null || nodeId === undefined) {
638
638
  return null;
639
639
  }
640
- return await node.domModel().cssModel().getComputedStyle(node.id);
640
+ return await node.domModel().cssModel().getComputedStyle(nodeId);
641
641
  }
642
642
 
643
643
  onResize(): void {
@@ -83,10 +83,7 @@
83
83
  width: 210px;
84
84
  }
85
85
 
86
- .perfmon-indicator:hover {
87
- background-color: var(--color-background-elevation-0);
88
- }
89
-
86
+ .perfmon-indicator:hover,
90
87
  .perfmon-indicator:focus-visible {
91
88
  background-color: var(--color-background-elevation-1);
92
89
  }
@@ -319,15 +319,13 @@ const UIStrings = {
319
319
  */
320
320
  protocol: 'Protocol',
321
321
  /**
322
- *@description Text in Security Panel of the Security panel
322
+ *@description Text in the Security panel that refers to how the TLS handshake
323
+ *established encryption keys.
323
324
  */
324
325
  keyExchange: 'Key exchange',
325
326
  /**
326
- *@description Text in Security Panel of the Security panel
327
- */
328
- keyExchangeGroup: 'Key exchange group',
329
- /**
330
- *@description Text in Security Panel of the Security panel
327
+ *@description Text in Security Panel that refers to how the TLS handshake
328
+ *encrypted data.
331
329
  */
332
330
  cipher: 'Cipher',
333
331
  /**
@@ -1439,12 +1437,35 @@ export class SecurityOriginView extends UI.Widget.VBox {
1439
1437
  let table: SecurityDetailsTable = new SecurityDetailsTable();
1440
1438
  connectionSection.appendChild(table.element());
1441
1439
  table.addRow(i18nString(UIStrings.protocol), originState.securityDetails.protocol);
1442
- if (originState.securityDetails.keyExchange) {
1440
+
1441
+ // A TLS connection negotiates a cipher suite and, when doing an ephemeral
1442
+ // ECDH key exchange, a "named group". In TLS 1.2, the cipher suite is
1443
+ // named like TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256. The DevTools protocol
1444
+ // tried to decompose this name and calls the "ECDHE_RSA" portion the
1445
+ // "keyExchange", because it determined the rough shape of the key
1446
+ // exchange portion of the handshake. (A keyExchange of "RSA" meant a very
1447
+ // different handshake set.) But ECDHE_RSA was still parameterized by a
1448
+ // named group (e.g. X25519), which the DevTools protocol exposes as
1449
+ // "keyExchangeGroup".
1450
+ //
1451
+ // Then, starting TLS 1.3, the cipher suites are named like
1452
+ // TLS_AES_128_GCM_SHA256. The handshake shape is implicit in the
1453
+ // protocol. keyExchange is empty and we only have keyExchangeGroup.
1454
+ //
1455
+ // "Key exchange group" isn't common terminology and, in TLS 1.3,
1456
+ // something like "X25519" is better labelled as "key exchange" than "key
1457
+ // exchange group" anyway. So combine the two fields when displaying in
1458
+ // the UI.
1459
+ if (originState.securityDetails.keyExchange && originState.securityDetails.keyExchangeGroup) {
1460
+ table.addRow(
1461
+ i18nString(UIStrings.keyExchange),
1462
+ originState.securityDetails.keyExchange + ' with ' + originState.securityDetails.keyExchangeGroup);
1463
+ } else if (originState.securityDetails.keyExchange) {
1443
1464
  table.addRow(i18nString(UIStrings.keyExchange), originState.securityDetails.keyExchange);
1465
+ } else if (originState.securityDetails.keyExchangeGroup) {
1466
+ table.addRow(i18nString(UIStrings.keyExchange), originState.securityDetails.keyExchangeGroup);
1444
1467
  }
1445
- if (originState.securityDetails.keyExchangeGroup) {
1446
- table.addRow(i18nString(UIStrings.keyExchangeGroup), originState.securityDetails.keyExchangeGroup);
1447
- }
1468
+
1448
1469
  table.addRow(
1449
1470
  i18nString(UIStrings.cipher),
1450
1471
  originState.securityDetails.cipher +
@@ -1645,14 +1666,14 @@ export class SecurityDetailsTable {
1645
1666
  }
1646
1667
 
1647
1668
  addRow(key: string, value: string|Node): void {
1648
- const row = this.elementInternal.createChild('div', 'details-table-row');
1649
- row.createChild('div').textContent = key;
1669
+ const row = this.elementInternal.createChild('tr', 'details-table-row');
1670
+ row.createChild('td').textContent = key;
1650
1671
 
1651
- const valueDiv = row.createChild('div');
1672
+ const valueCell = row.createChild('td');
1652
1673
  if (typeof value === 'string') {
1653
- valueDiv.textContent = value;
1674
+ valueCell.textContent = value;
1654
1675
  } else {
1655
- valueDiv.appendChild(value);
1676
+ valueCell.appendChild(value);
1656
1677
  }
1657
1678
  }
1658
1679
  }
@@ -62,37 +62,38 @@
62
62
  font-weight: bold;
63
63
  }
64
64
 
65
+ .security-origin-view .details-table {
66
+ border-spacing: 0;
67
+ }
68
+
65
69
  .security-origin-view .details-table-row {
66
- display: flex;
67
70
  white-space: nowrap;
68
71
  overflow: hidden;
69
72
  line-height: 22px;
73
+ vertical-align: top;
70
74
  }
71
75
 
72
- .security-origin-view .details-table-row > div {
73
- align-items: flex-start;
76
+ .security-origin-view .details-table-row > td {
77
+ padding: 0;
74
78
  }
75
79
 
76
- .security-origin-view .details-table-row > div:first-child {
80
+ .security-origin-view .details-table-row > td:first-child {
77
81
  color: var(--color-text-secondary);
78
- width: 110px;
79
- margin-right: 1em;
80
- flex: none;
81
- display: flex;
82
- justify-content: flex-end;
82
+ width: calc(110px + 1em);
83
+ text-align: right;
84
+ padding-right: 1em;
83
85
  }
84
86
 
85
- .security-origin-view .details-table-row > div:nth-child(2) {
86
- flex: auto;
87
+ .security-origin-view .details-table-row > td:nth-child(2) {
87
88
  white-space: normal;
88
89
  }
89
90
 
90
- .security-origin-view .sct-details .details-table .details-table-row:last-child div:last-child {
91
+ .security-origin-view .sct-details .details-table .details-table-row:last-child td:last-child {
91
92
  border-bottom: 1px solid var(--color-background-elevation-2);
92
93
  padding-bottom: 10px;
93
94
  }
94
95
 
95
- .security-origin-view .sct-details .details-table:last-child .details-table-row:last-child div:last-child {
96
+ .security-origin-view .sct-details .details-table:last-child .details-table-row:last-child td:last-child {
96
97
  border-bottom: none;
97
98
  padding-bottom: 0;
98
99
  }
@@ -217,6 +217,33 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
217
217
  return {obj, address};
218
218
  }
219
219
 
220
+ // This function returns the size of the source language value represented
221
+ // by the ValueNode. If the value is a pointer, the function returns the size of
222
+ // the pointed-to value. If the pointed-to value is also a pointer, it returns
223
+ // the size of the pointer (usually 4 bytes) to stay consistent with the DWARF extension.
224
+ // > double x = 42.0;
225
+ // > double *ptr = &x;
226
+ // > double **dblptr = &ptr;
227
+ //
228
+ // retrieveObjectSize(ptr_ValueNode) -> 8, the size of a double
229
+ // retrieveObjectSize(dblptr_ValueNode) -> 4, the size of a pointer
230
+ static retrieveObjectSize(obj: Bindings.DebuggerLanguagePlugins.ValueNode): number {
231
+ let typeInfo = obj.sourceType.typeInfo;
232
+ const pointerMembers = typeInfo.members.filter(member => member.name === '*');
233
+ if (pointerMembers.length === 1) {
234
+ const typeId = pointerMembers[0].typeId;
235
+ const newTypeInfo = obj.sourceType.typeMap.get(typeId)?.typeInfo;
236
+ if (newTypeInfo !== undefined) {
237
+ typeInfo = newTypeInfo;
238
+ } else {
239
+ throw new Error(`Cannot find the source type information for typeId ${typeId}.`);
240
+ }
241
+ } else if (pointerMembers.length > 1) {
242
+ throw new Error('The number of pointers in typeInfo.members should not be greater than one.');
243
+ }
244
+ return typeInfo.size;
245
+ }
246
+
220
247
  async openInspectorView(obj: SDK.RemoteObject.RemoteObject, address?: number): Promise<void> {
221
248
  const response = await LinearMemoryInspectorController.retrieveDWARFMemoryObjectAndAddress(obj);
222
249
  let memoryObj = obj;
@@ -268,14 +295,13 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
268
295
  #extractHighlightInfo(obj: SDK.RemoteObject.RemoteObject, memoryAddress?: number): HighlightInfo|undefined {
269
296
  let highlightInfo;
270
297
  if (obj instanceof Bindings.DebuggerLanguagePlugins.ValueNode) {
271
- // Currently, only the StaticallyTypedValueNode subclass implements the sourceType getter.
272
- // The other subclasses throw a 'Not Implemented' Error.
273
298
  try {
274
299
  highlightInfo = {
275
300
  startAddress: memoryAddress || 0,
276
- size: obj.sourceType.typeInfo.size,
301
+ size: LinearMemoryInspectorController.retrieveObjectSize(obj),
277
302
  };
278
- } catch (unusedError) {
303
+ } catch (err) {
304
+ highlightInfo = undefined;
279
305
  }
280
306
  }
281
307
  return highlightInfo;
@@ -238,6 +238,7 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
238
238
  address: address,
239
239
  memoryOffset: start,
240
240
  outerMemoryLength: this.#memoryWrapper.length(),
241
+ highlightInfo: this.#highlightInfo,
241
242
  };
242
243
  });
243
244
  }
@@ -31,7 +31,6 @@
31
31
  }
32
32
 
33
33
  .webkit-html-comment {
34
- /* Keep this in sync with view-source.css (.webkit-html-comment) */
35
34
  color: var(--color-token-comment);
36
35
  }
37
36
 
@@ -231,7 +231,7 @@
231
231
  --color-syntax-3: rgb(242 151 102);
232
232
  --color-syntax-4: rgb(155 187 220);
233
233
  --color-syntax-5: rgb(132 240 255);
234
- --color-syntax-6: rgb(137 137 137);
234
+ --color-syntax-6: rgb(171 171 171);
235
235
  --color-syntax-7: rgb(207 208 208);
236
236
  --color-syntax-8: rgb(93 176 215);
237
237
  --drop-shadow:
@@ -301,7 +301,7 @@
301
301
  --color-token-string-special: var(--color-token-string);
302
302
  --color-token-atom: rgb(161 247 181);
303
303
  --color-token-number: var(--color-token-atom);
304
- --color-token-comment: rgb(137 137 137);
304
+ --color-token-comment: var(--color-syntax-6);
305
305
  --color-token-tag: rgb(93 176 215);
306
306
  --color-token-attribute: rgb(155 187 220);
307
307
  --color-token-attribute-value: rgb(242 151 102);
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "vpython third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.1024166"
58
+ "version": "1.0.1025068"
59
59
  }