chrome-devtools-frontend 1.0.1024166 → 1.0.1024644
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.
- package/front_end/core/i18n/locales/en-US.json +0 -3
- package/front_end/core/i18n/locales/en-XL.json +0 -3
- package/front_end/core/sdk/CSSMatchedStyles.ts +7 -1
- package/front_end/core/sdk/CSSModel.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -0
- package/front_end/models/issues_manager/DeprecationIssue.ts +2 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +10 -10
- package/front_end/panels/security/SecurityPanel.ts +36 -15
- package/front_end/panels/security/originView.css +14 -13
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +30 -4
- package/package.json +1 -1
@@ -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[]> {
|
@@ -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 =
|
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 =
|
370
|
+
milestone = 109;
|
371
371
|
break;
|
372
372
|
case Protocol.Audits.DeprecationIssueType.EventPath:
|
373
373
|
messageFunction = i18nLazyString(UIStrings.eventPath);
|
@@ -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
|
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
|
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(
|
637
|
-
|
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(
|
640
|
+
return await node.domModel().cssModel().getComputedStyle(nodeId);
|
641
641
|
}
|
642
642
|
|
643
643
|
onResize(): void {
|
@@ -319,15 +319,13 @@ const UIStrings = {
|
|
319
319
|
*/
|
320
320
|
protocol: 'Protocol',
|
321
321
|
/**
|
322
|
-
*@description Text in Security
|
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
|
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
|
-
|
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
|
-
|
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('
|
1649
|
-
row.createChild('
|
1669
|
+
const row = this.elementInternal.createChild('tr', 'details-table-row');
|
1670
|
+
row.createChild('td').textContent = key;
|
1650
1671
|
|
1651
|
-
const
|
1672
|
+
const valueCell = row.createChild('td');
|
1652
1673
|
if (typeof value === 'string') {
|
1653
|
-
|
1674
|
+
valueCell.textContent = value;
|
1654
1675
|
} else {
|
1655
|
-
|
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 >
|
73
|
-
|
76
|
+
.security-origin-view .details-table-row > td {
|
77
|
+
padding: 0;
|
74
78
|
}
|
75
79
|
|
76
|
-
.security-origin-view .details-table-row >
|
80
|
+
.security-origin-view .details-table-row > td:first-child {
|
77
81
|
color: var(--color-text-secondary);
|
78
|
-
width: 110px;
|
79
|
-
|
80
|
-
|
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 >
|
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
|
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
|
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
|
301
|
+
size: LinearMemoryInspectorController.retrieveObjectSize(obj),
|
277
302
|
};
|
278
|
-
} catch (
|
303
|
+
} catch (err) {
|
304
|
+
highlightInfo = undefined;
|
279
305
|
}
|
280
306
|
}
|
281
307
|
return highlightInfo;
|
package/package.json
CHANGED