chrome-devtools-frontend 1.0.1649421 → 1.0.1650035
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/sdk/CSSMetadata.ts +19 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +15 -0
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +1 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +97 -57
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +10 -10
- package/package.json +1 -1
|
@@ -55,6 +55,11 @@ export class CSSMetadata {
|
|
|
55
55
|
for (let i = 0; i < properties.length; ++i) {
|
|
56
56
|
const property = properties[i];
|
|
57
57
|
const propertyName = property.name;
|
|
58
|
+
if ('is_descriptor' in property && 'is_property' in property) {
|
|
59
|
+
if (property.is_descriptor && !property.is_property) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
58
63
|
if (!CSS.supports(propertyName, 'initial')) {
|
|
59
64
|
continue;
|
|
60
65
|
}
|
|
@@ -99,9 +104,18 @@ export class CSSMetadata {
|
|
|
99
104
|
propertyValueSets.set(propertyName, extraValues);
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
// finally add common keywords to value sets and convert property #values
|
|
107
|
+
// finally add keywords from alias property, common keywords to value sets and convert property #values
|
|
103
108
|
// into arrays since callers expect arrays
|
|
104
109
|
for (const [propertyName, values] of propertyValueSets) {
|
|
110
|
+
const aliasFor = this.#aliasesFor.get(propertyName);
|
|
111
|
+
if (aliasFor) {
|
|
112
|
+
const aliasForValues = propertyValueSets.get(aliasFor);
|
|
113
|
+
if (aliasForValues) {
|
|
114
|
+
for (const val of aliasForValues) {
|
|
115
|
+
values.add(val);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
105
119
|
for (const commonKeyword of CommonKeywords) {
|
|
106
120
|
if (!values.has(commonKeyword) && CSS.supports(propertyName, commonKeyword)) {
|
|
107
121
|
values.add(commonKeyword);
|
|
@@ -1675,4 +1689,8 @@ export interface CSSPropertyDefinition {
|
|
|
1675
1689
|
longhands: string[]|null;
|
|
1676
1690
|
inherited: boolean|null;
|
|
1677
1691
|
svg: boolean|null;
|
|
1692
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1693
|
+
is_descriptor?: boolean;
|
|
1694
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1695
|
+
is_property?: boolean;
|
|
1678
1696
|
}
|
|
@@ -1382,6 +1382,12 @@ export abstract class HeapSnapshot {
|
|
|
1382
1382
|
};
|
|
1383
1383
|
|
|
1384
1384
|
switch (filterName) {
|
|
1385
|
+
case 'objectsRetainedByContexts':
|
|
1386
|
+
traverse((_node: HeapSnapshotNode, edge: HeapSnapshotEdge) => {
|
|
1387
|
+
return !this.isContextObject(edge.node());
|
|
1388
|
+
});
|
|
1389
|
+
markUnreachableNodes();
|
|
1390
|
+
return (node: HeapSnapshotNode) => !getBit(node);
|
|
1385
1391
|
case 'objectsRetainedByDetachedDomNodes':
|
|
1386
1392
|
// Traverse the graph, avoiding detached nodes.
|
|
1387
1393
|
traverse((_node: HeapSnapshotNode, edge: HeapSnapshotEdge) => {
|
|
@@ -1581,6 +1587,10 @@ export abstract class HeapSnapshot {
|
|
|
1581
1587
|
return true;
|
|
1582
1588
|
}
|
|
1583
1589
|
|
|
1590
|
+
isContextObject(_node: HeapSnapshotNode): boolean {
|
|
1591
|
+
return false;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1584
1594
|
calculateShallowSizes(): void {
|
|
1585
1595
|
}
|
|
1586
1596
|
|
|
@@ -3684,6 +3694,11 @@ export class JSHeapSnapshot extends HeapSnapshot {
|
|
|
3684
3694
|
return node.isUserRoot() || node.isDocumentDOMTreesRoot();
|
|
3685
3695
|
}
|
|
3686
3696
|
|
|
3697
|
+
override isContextObject(node: HeapSnapshotNode): boolean {
|
|
3698
|
+
const name = node.rawName();
|
|
3699
|
+
return name === 'system / Context' || name.startsWith('system / Context / ');
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3687
3702
|
override userObjectsMapAndFlag(): {map: Uint8Array, flag: number}|null {
|
|
3688
3703
|
return {map: this.flags, flag: this.nodeFlags.pageObject};
|
|
3689
3704
|
}
|
|
@@ -54,6 +54,10 @@ export const UIStrings = {
|
|
|
54
54
|
* @description Warning displayed to developers when a data: URL is assigned to SVGUseElement to let them know that the support is deprecated.
|
|
55
55
|
*/
|
|
56
56
|
DataUrlInSvgUse: "Support for data: URLs in SVGUseElement is deprecated and it will be removed in the future.",
|
|
57
|
+
/**
|
|
58
|
+
* @description Warning displayed to developers when an unknown protocol string is used in a call to navigator.credentials.get() or create() with the 'digital' option.
|
|
59
|
+
*/
|
|
60
|
+
DigitalCredentialsUnknownProtocol: "An unknown Digital Credentials protocol was requested in navigator.credentials.get() or create(). In a future release, unrecognized protocols will be blocked.",
|
|
57
61
|
/**
|
|
58
62
|
* @description Warning displayed to developers when document.createEvent() is called with 'KeyboardEvents', which is a non-standard event interface that will be removed.
|
|
59
63
|
*/
|
|
@@ -333,6 +337,10 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
|
|
|
333
337
|
"chromeStatusFeature": 5128825141198848,
|
|
334
338
|
"milestone": 119
|
|
335
339
|
},
|
|
340
|
+
"DigitalCredentialsUnknownProtocol": {
|
|
341
|
+
"chromeStatusFeature": 6492906882990080,
|
|
342
|
+
"milestone": 160
|
|
343
|
+
},
|
|
336
344
|
"DocumentCreateEventKeyboardEvents": {
|
|
337
345
|
"chromeStatusFeature": 5095987863486464,
|
|
338
346
|
"milestone": 151
|
|
@@ -1430,7 +1430,7 @@ export const NativeFunctions = [
|
|
|
1430
1430
|
},
|
|
1431
1431
|
{
|
|
1432
1432
|
name: "add",
|
|
1433
|
-
signatures: [["
|
|
1433
|
+
signatures: [["install_paths"]],
|
|
1434
1434
|
receivers: ["SubApps"]
|
|
1435
1435
|
},
|
|
1436
1436
|
{
|
|
@@ -2005,7 +2005,7 @@ export const NativeFunctions = [
|
|
|
2005
2005
|
},
|
|
2006
2006
|
{
|
|
2007
2007
|
name: "remove",
|
|
2008
|
-
signatures: [["
|
|
2008
|
+
signatures: [["manifest_ids"]],
|
|
2009
2009
|
receivers: ["SubApps"]
|
|
2010
2010
|
},
|
|
2011
2011
|
{
|
|
@@ -403,6 +403,7 @@ export class ConsolePinPresenter extends UI.Widget.Widget {
|
|
|
403
403
|
CodeMirror.EditorView.domEventHandlers({
|
|
404
404
|
blur: (_e, view) => this.#onBlur(view),
|
|
405
405
|
paste: () => this.#onPaste(),
|
|
406
|
+
drop: event => event.preventDefault(),
|
|
406
407
|
}),
|
|
407
408
|
TextEditor.Config.baseConfiguration(doc),
|
|
408
409
|
TextEditor.Config.closeBrackets.instance(),
|
|
@@ -738,65 +738,86 @@ function renderLinkifiedValue(value: string, node: SDK.DOMModel.DOMNode): Lit.Te
|
|
|
738
738
|
});
|
|
739
739
|
}
|
|
740
740
|
|
|
741
|
+
const relationPromisesCache = new WeakMap<SDK.DOMModel.DOMNode, Map<string, Promise<string|Lit.LitTemplate>>>();
|
|
742
|
+
const relatedElementsCache = new WeakMap<SDK.DOMModel.DOMNode, Map<string, SDK.DOMModel.DOMNode|null>>();
|
|
743
|
+
|
|
741
744
|
function renderAttribute(
|
|
742
745
|
attr: {name: string, value?: string}, updateRecord: Elements.ElementUpdateRecord.ElementUpdateRecord|null,
|
|
743
746
|
isDiff: boolean, node: SDK.DOMModel.DOMNode): Lit.LitTemplate {
|
|
744
747
|
const name = attr.name;
|
|
745
748
|
const value = attr.value || '';
|
|
746
749
|
const forceValue = isDiff;
|
|
750
|
+
const isRelation = name === 'popovertarget' || name === 'interesttarget' || name === 'commandfor';
|
|
747
751
|
const hasText = (forceValue || value.length > 0);
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
dblclick: true,
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
const relationRef =
|
|
754
|
-
(relation: Protocol.DOM.GetElementByRelationRequestRelation, tooltip: string): ReturnType<typeof ref> =>
|
|
755
|
-
ref((el): void => {
|
|
756
|
-
if (!el) {
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
void (async(): Promise<void> => {
|
|
760
|
-
const relatedElementId = await node.domModel().getElementByRelation(node.id, relation);
|
|
761
|
-
const relatedElement = node.domModel().nodeForId(relatedElementId);
|
|
762
|
-
if (!relatedElement) {
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
const link = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(relatedElement, {
|
|
766
|
-
preventKeyboardFocus: true,
|
|
767
|
-
tooltip,
|
|
768
|
-
textContent: el.textContent || undefined,
|
|
769
|
-
isDynamicLink: true,
|
|
770
|
-
});
|
|
771
|
-
render(link, el as HTMLElement);
|
|
772
|
-
})();
|
|
773
|
-
});
|
|
752
|
+
const linkifyName = isRelation && value.length === 0;
|
|
753
|
+
const linkifyValue = isRelation && value.length > 0;
|
|
774
754
|
|
|
775
|
-
let
|
|
776
|
-
|
|
755
|
+
let relation: Protocol.DOM.GetElementByRelationRequestRelation|undefined = undefined;
|
|
756
|
+
let tooltip = '';
|
|
757
|
+
if (isRelation) {
|
|
777
758
|
if (name === 'popovertarget') {
|
|
778
|
-
|
|
779
|
-
|
|
759
|
+
relation = Protocol.DOM.GetElementByRelationRequestRelation.PopoverTarget;
|
|
760
|
+
tooltip = i18nString(UIStrings.showPopoverTarget);
|
|
780
761
|
} else if (name === 'interesttarget') {
|
|
781
|
-
|
|
782
|
-
|
|
762
|
+
relation = Protocol.DOM.GetElementByRelationRequestRelation.InterestTarget;
|
|
763
|
+
tooltip = i18nString(UIStrings.showInterestTarget);
|
|
783
764
|
} else if (name === 'commandfor') {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
}
|
|
765
|
+
relation = Protocol.DOM.GetElementByRelationRequestRelation.CommandFor;
|
|
766
|
+
tooltip = i18nString(UIStrings.showCommandForTarget);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
let relationPromise: Promise<string|Lit.LitTemplate>|undefined = undefined;
|
|
771
|
+
if (isRelation && relation) {
|
|
772
|
+
let nodeCache = relationPromisesCache.get(node);
|
|
773
|
+
if (!nodeCache) {
|
|
774
|
+
nodeCache = new Map();
|
|
775
|
+
relationPromisesCache.set(node, nodeCache);
|
|
776
|
+
}
|
|
777
|
+
const cacheKey = `${relation}:${value}`;
|
|
778
|
+
relationPromise = nodeCache.get(cacheKey);
|
|
779
|
+
const relationType = relation;
|
|
780
|
+
if (!relationPromise) {
|
|
781
|
+
relationPromise = (async () => {
|
|
782
|
+
try {
|
|
783
|
+
const relatedElementId = await node.domModel().getElementByRelation(node.id, relationType);
|
|
784
|
+
const relatedElement = node.domModel().nodeForId(relatedElementId);
|
|
785
|
+
|
|
786
|
+
let elemCache = relatedElementsCache.get(node);
|
|
787
|
+
if (!elemCache) {
|
|
788
|
+
elemCache = new Map();
|
|
789
|
+
relatedElementsCache.set(node, elemCache);
|
|
790
|
+
}
|
|
791
|
+
elemCache.set(`${name}:${value}`, relatedElement || null);
|
|
788
792
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
793
|
+
const isNameLinking = value.length === 0;
|
|
794
|
+
const fallback = isNameLinking ? name : value;
|
|
795
|
+
|
|
796
|
+
if (!relatedElement) {
|
|
797
|
+
return fallback;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
const linkOptions: PanelsCommon.DOMLinkifier.Options = {
|
|
801
|
+
preventKeyboardFocus: true,
|
|
802
|
+
tooltip,
|
|
803
|
+
isDynamicLink: true,
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
if (isNameLinking) {
|
|
807
|
+
linkOptions.textContent = name;
|
|
808
|
+
} else {
|
|
809
|
+
const targetId = relatedElement.getAttribute('id');
|
|
810
|
+
if (targetId) {
|
|
811
|
+
linkOptions.textContent = targetId;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(relatedElement, linkOptions);
|
|
816
|
+
} catch {
|
|
817
|
+
return value.length === 0 ? name : value;
|
|
818
|
+
}
|
|
819
|
+
})();
|
|
820
|
+
nodeCache.set(cacheKey, relationPromise);
|
|
800
821
|
}
|
|
801
822
|
}
|
|
802
823
|
|
|
@@ -815,23 +836,31 @@ function renderAttribute(
|
|
|
815
836
|
valueType = ValueType.SRCSET;
|
|
816
837
|
}
|
|
817
838
|
|
|
818
|
-
const withEntitiesRef = valueType === ValueType.UNKNOWN ? ref(el => {
|
|
839
|
+
const withEntitiesRef = (valueType === ValueType.UNKNOWN && !isRelation) ? ref(el => {
|
|
819
840
|
if (el) {
|
|
820
841
|
setValueWithEntities(el, value);
|
|
821
842
|
}
|
|
822
843
|
}) :
|
|
823
|
-
|
|
844
|
+
nothing;
|
|
845
|
+
|
|
846
|
+
const jslog = VisualLogging.value(name === 'style' ? 'style-attribute' : 'attribute').track({
|
|
847
|
+
change: true,
|
|
848
|
+
dblclick: true,
|
|
849
|
+
});
|
|
824
850
|
|
|
825
|
-
// clang-format off
|
|
826
851
|
return html`<span class="webkit-html-attribute" jslog=${jslog}><span class="webkit-html-attribute-name"
|
|
827
|
-
${animateOn(Boolean(updateRecord?.isAttributeModified(name) && !hasText), DOM_UPDATE_ANIMATION_CLASS_NAME)}
|
|
828
|
-
|
|
829
|
-
|
|
852
|
+
${animateOn(Boolean(updateRecord?.isAttributeModified(name) && !hasText), DOM_UPDATE_ANIMATION_CLASS_NAME)}>${
|
|
853
|
+
linkifyName && relationPromise ? Lit.Directives.until(relationPromise, name) : name}</span>${
|
|
854
|
+
hasText ?
|
|
855
|
+
html`=\u200B"<span class="webkit-html-attribute-value" ${
|
|
856
|
+
animateOn(Boolean(updateRecord?.isAttributeModified(name) && hasText),
|
|
857
|
+
DOM_UPDATE_ANIMATION_CLASS_NAME)} ${withEntitiesRef}>
|
|
830
858
|
${valueType === ValueType.SRC ? renderLinkifiedValue(value, node) : nothing}
|
|
831
|
-
${
|
|
859
|
+
${
|
|
860
|
+
valueType === ValueType.SRCSET ? renderLinkifiedSrcset(Common.Srcset.parseSrcset(value), node) : nothing}
|
|
861
|
+
${linkifyValue && relationPromise ? Lit.Directives.until(relationPromise, value) : nothing}
|
|
832
862
|
</span>"` :
|
|
833
|
-
|
|
834
|
-
// clang-format on
|
|
863
|
+
nothing}</span>`;
|
|
835
864
|
}
|
|
836
865
|
|
|
837
866
|
function renderTag(
|
|
@@ -2440,9 +2469,20 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2440
2469
|
}
|
|
2441
2470
|
}
|
|
2442
2471
|
|
|
2443
|
-
|
|
2472
|
+
let attributeValue = attributeName && attributeValueElement ?
|
|
2444
2473
|
this.nodeInternal.getAttribute(attributeName)?.replaceAll('"', '"') :
|
|
2445
2474
|
undefined;
|
|
2475
|
+
|
|
2476
|
+
const isRelation =
|
|
2477
|
+
attributeName === 'popovertarget' || attributeName === 'interesttarget' || attributeName === 'commandfor';
|
|
2478
|
+
if (isRelation && attributeName && attributeValueElement) {
|
|
2479
|
+
const rawValue = this.nodeInternal.getAttribute(attributeName) || '';
|
|
2480
|
+
const relatedElement = relatedElementsCache.get(this.nodeInternal)?.get(`${attributeName}:${rawValue}`);
|
|
2481
|
+
if (relatedElement) {
|
|
2482
|
+
attributeValue = relatedElement.getAttribute('id') || '';
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2446
2486
|
if (attributeValue !== undefined) {
|
|
2447
2487
|
attributeValueElement.setTextContentTruncatedIfNeeded(
|
|
2448
2488
|
attributeValue, i18nString(UIStrings.valueIsTooLargeToEdit));
|
|
@@ -136,6 +136,11 @@ const UIStrings = {
|
|
|
136
136
|
* detached DOM nodes and other objects kept alive by detached DOM nodes
|
|
137
137
|
*/
|
|
138
138
|
objectsRetainedByDetachedDomNodes: 'Objects retained by detached DOM nodes',
|
|
139
|
+
/**
|
|
140
|
+
* @description An option which will filter the heap snapshot to show only
|
|
141
|
+
* objects kept alive by contexts
|
|
142
|
+
*/
|
|
143
|
+
objectsRetainedByContexts: 'Objects retained by contexts',
|
|
139
144
|
/**
|
|
140
145
|
* @description An option which will filter the heap snapshot to show only
|
|
141
146
|
* objects kept alive by the DevTools console
|
|
@@ -773,6 +778,7 @@ export class HeapSnapshotView extends UI.View.SimpleView implements DataDisplayD
|
|
|
773
778
|
static readonly ALWAYS_AVAILABLE_FILTERS: ReadonlyArray<{uiName: string, filterName: string}> = [
|
|
774
779
|
{uiName: i18nString(UIStrings.duplicatedStrings), filterName: 'duplicatedStrings'},
|
|
775
780
|
{uiName: i18nString(UIStrings.objectsRetainedByDetachedDomNodes), filterName: 'objectsRetainedByDetachedDomNodes'},
|
|
781
|
+
{uiName: i18nString(UIStrings.objectsRetainedByContexts), filterName: 'objectsRetainedByContexts'},
|
|
776
782
|
{uiName: i18nString(UIStrings.objectsRetainedByConsole), filterName: 'objectsRetainedByConsole'},
|
|
777
783
|
{uiName: i18nString(UIStrings.objectsRetainedByEventHandlers), filterName: 'objectsRetainedByEventHandlers'},
|
|
778
784
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 497ce88cb71102650c4ed3ec5fa40ddd45c28c26
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -257,6 +257,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
257
257
|
focus: () => this.onFocus(),
|
|
258
258
|
blur: () => this.onBlur(),
|
|
259
259
|
paste: () => this.onPaste(),
|
|
260
|
+
drop: event => event.preventDefault(),
|
|
260
261
|
scroll: () => this.dispatchEventToListeners(Events.EDITOR_SCROLL),
|
|
261
262
|
contextmenu: event => this.onContextMenu(event),
|
|
262
263
|
}),
|
|
@@ -264,16 +265,15 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
264
265
|
domEventHandlers:
|
|
265
266
|
{contextmenu: (_view, block, event) => this.onLineGutterContextMenu(block.from, event as MouseEvent)},
|
|
266
267
|
}),
|
|
267
|
-
CodeMirror.EditorView.updateListener.of(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}),
|
|
268
|
+
CodeMirror.EditorView.updateListener.of((update):
|
|
269
|
+
void => {
|
|
270
|
+
if (update.selectionSet || update.docChanged) {
|
|
271
|
+
this.updateSourcePosition();
|
|
272
|
+
}
|
|
273
|
+
if (update.docChanged) {
|
|
274
|
+
this.onTextChanged();
|
|
275
|
+
}
|
|
276
|
+
}),
|
|
277
277
|
activeSearchState,
|
|
278
278
|
CodeMirror.Prec.lowest(searchHighlighter),
|
|
279
279
|
config.language.of([]),
|
package/package.json
CHANGED