chrome-devtools-frontend 1.0.974575 → 1.0.975541
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/config/gni/devtools_grd_files.gni +5 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_layers_16x16.svg +11 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +13 -1
- package/front_end/core/i18n/locales/en-XL.json +13 -1
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/CSSLayer.ts +30 -0
- package/front_end/core/sdk/CSSModel.ts +5 -0
- package/front_end/core/sdk/CSSRule.ts +3 -0
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +3 -0
- package/front_end/entrypoints/formatter_worker/Substitute.ts +536 -0
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +5 -0
- package/front_end/generated/protocol.ts +6 -0
- package/front_end/models/issues_manager/IssuesManager.ts +6 -0
- package/front_end/panels/elements/LayersWidget.ts +167 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +71 -3
- package/front_end/panels/elements/elements-meta.ts +15 -2
- package/front_end/panels/elements/elements.ts +2 -0
- package/front_end/panels/elements/layersWidget.css +28 -0
- package/front_end/panels/elements/stylesSidebarPane.css +4 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -3
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +1 -0
- package/package.json +1 -1
- package/scripts/build/assert_grd.py +1 -1
- package/scripts/build/assert_third_party_readmes.py +1 -1
- package/scripts/build/build_inspector_overlay.py +1 -1
- package/scripts/build/code_generator_frontend.py +1 -1
- package/scripts/build/efficiently_recompile.py +1 -1
- package/scripts/build/generate_aria.py +2 -0
- package/scripts/build/generate_devtools_grd.py +1 -5
- package/scripts/build/generate_supported_css.py +6 -5
@@ -83,6 +83,7 @@ grd_files_release_sources = [
|
|
83
83
|
"front_end/Images/ic_folder_local.svg",
|
84
84
|
"front_end/Images/ic_folder_network.svg",
|
85
85
|
"front_end/Images/ic_info_black_18dp.svg",
|
86
|
+
"front_end/Images/ic_layers_16x16.svg",
|
86
87
|
"front_end/Images/ic_memory_16x16.svg",
|
87
88
|
"front_end/Images/ic_page_next_16x16_icon.svg",
|
88
89
|
"front_end/Images/ic_page_prev_16x16_icon.svg",
|
@@ -592,6 +593,7 @@ grd_files_debug_sources = [
|
|
592
593
|
"front_end/core/sdk/CPUThrottlingManager.js",
|
593
594
|
"front_end/core/sdk/CSSContainerQuery.js",
|
594
595
|
"front_end/core/sdk/CSSFontFace.js",
|
596
|
+
"front_end/core/sdk/CSSLayer.js",
|
595
597
|
"front_end/core/sdk/CSSMatchedStyles.js",
|
596
598
|
"front_end/core/sdk/CSSMedia.js",
|
597
599
|
"front_end/core/sdk/CSSMetadata.js",
|
@@ -666,6 +668,7 @@ grd_files_debug_sources = [
|
|
666
668
|
"front_end/entrypoints/formatter_worker/JSONFormatter.js",
|
667
669
|
"front_end/entrypoints/formatter_worker/JavaScriptFormatter.js",
|
668
670
|
"front_end/entrypoints/formatter_worker/JavaScriptOutline.js",
|
671
|
+
"front_end/entrypoints/formatter_worker/Substitute.js",
|
669
672
|
"front_end/entrypoints/heap_snapshot_worker/AllocationProfile.js",
|
670
673
|
"front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.js",
|
671
674
|
"front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.js",
|
@@ -933,6 +936,7 @@ grd_files_debug_sources = [
|
|
933
936
|
"front_end/panels/elements/EventListenersWidget.js",
|
934
937
|
"front_end/panels/elements/ImagePreviewPopover.js",
|
935
938
|
"front_end/panels/elements/InspectElementModeController.js",
|
939
|
+
"front_end/panels/elements/LayersWidget.js",
|
936
940
|
"front_end/panels/elements/LayoutSidebarPane.js",
|
937
941
|
"front_end/panels/elements/MarkerDecorator.js",
|
938
942
|
"front_end/panels/elements/MetricsSidebarPane.js",
|
@@ -978,6 +982,7 @@ grd_files_debug_sources = [
|
|
978
982
|
"front_end/panels/elements/elementStatePaneWidget.css.js",
|
979
983
|
"front_end/panels/elements/elementsPanel.css.js",
|
980
984
|
"front_end/panels/elements/elementsTreeOutline.css.js",
|
985
|
+
"front_end/panels/elements/layersWidget.css.js",
|
981
986
|
"front_end/panels/elements/layoutPane.css.js",
|
982
987
|
"front_end/panels/elements/metricsSidebarPane.css.js",
|
983
988
|
"front_end/panels/elements/nodeStackTraceWidget.css.js",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<g clip-path="url(#clip0_101_638)">
|
3
|
+
<path d="M5.34247 8.54807L2.42415 9.82267C1.94959 10.0299 1.94959 10.859 2.42415 11.0663L7.822 13.4239C7.93714 13.4742 8.06277 13.4742 8.17792 13.4239L13.576 11.0663C14.0506 10.859 14.0506 10.0299 13.576 9.82266L10.6576 8.54803L9.05598 9.24755L11.7964 10.4445L7.99996 12.1026L4.20373 10.4445L6.9441 9.24761L5.34247 8.54807Z" fill="black"/>
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.20374 5.15001L7.99997 6.80809L11.7964 5.14999L8.0001 3.49191L4.20374 5.15001ZM2.42415 4.5282C1.94959 4.73547 1.94959 5.56454 2.42415 5.77181L7.822 8.12942C7.93715 8.17972 8.06277 8.17972 8.17792 8.12943L13.576 5.7718C14.0506 5.56453 14.0506 4.73546 13.576 4.52819L8.17806 2.17057C8.06291 2.12028 7.93729 2.12028 7.82214 2.17058L2.42415 4.5282Z" fill="black"/>
|
5
|
+
</g>
|
6
|
+
<defs>
|
7
|
+
<clipPath id="clip0_101_638">
|
8
|
+
<rect width="16" height="16" rx="2" fill="white"/>
|
9
|
+
</clipPath>
|
10
|
+
</defs>
|
11
|
+
</svg>
|
@@ -588,8 +588,9 @@ export enum DevtoolsExperiments {
|
|
588
588
|
'headerOverrides' = 56,
|
589
589
|
'lighthousePanelFR' = 57,
|
590
590
|
'evaluateExpressionsWithSourceMaps' = 58,
|
591
|
+
'cssLayers' = 59,
|
591
592
|
// Increment this when new experiments are added.
|
592
|
-
'MaxValue' =
|
593
|
+
'MaxValue' = 60,
|
593
594
|
}
|
594
595
|
/* eslint-enable @typescript-eslint/naming-convention */
|
595
596
|
|
@@ -4751,6 +4751,12 @@
|
|
4751
4751
|
"panels/elements/EventListenersWidget.ts | showListenersOnTheAncestors": {
|
4752
4752
|
"message": "Show listeners on the ancestors"
|
4753
4753
|
},
|
4754
|
+
"panels/elements/LayersWidget.ts | cssLayersTitle": {
|
4755
|
+
"message": "CSS layers"
|
4756
|
+
},
|
4757
|
+
"panels/elements/LayersWidget.ts | toggleCSSLayers": {
|
4758
|
+
"message": "Toggle CSS Layers view"
|
4759
|
+
},
|
4754
4760
|
"panels/elements/MarkerDecorator.ts | domBreakpoint": {
|
4755
4761
|
"message": "DOM Breakpoint"
|
4756
4762
|
},
|
@@ -4832,6 +4838,9 @@
|
|
4832
4838
|
"panels/elements/StylePropertyTreeElement.ts | viewComputedValue": {
|
4833
4839
|
"message": "View computed value"
|
4834
4840
|
},
|
4841
|
+
"panels/elements/StylesSidebarPane.ts | clickToRevealLayer": {
|
4842
|
+
"message": "Click to reveal layer in layer tree"
|
4843
|
+
},
|
4835
4844
|
"panels/elements/StylesSidebarPane.ts | constructedStylesheet": {
|
4836
4845
|
"message": "constructed stylesheet"
|
4837
4846
|
},
|
@@ -4886,6 +4895,9 @@
|
|
4886
4895
|
"panels/elements/StylesSidebarPane.ts | invalidString": {
|
4887
4896
|
"message": "{PH1}, property name: {PH2}, property value: {PH3}"
|
4888
4897
|
},
|
4898
|
+
"panels/elements/StylesSidebarPane.ts | layer": {
|
4899
|
+
"message": "Layer"
|
4900
|
+
},
|
4889
4901
|
"panels/elements/StylesSidebarPane.ts | newStyleRule": {
|
4890
4902
|
"message": "New Style Rule"
|
4891
4903
|
},
|
@@ -5823,7 +5835,7 @@
|
|
5823
5835
|
"message": "Timespan"
|
5824
5836
|
},
|
5825
5837
|
"panels/lighthouse/LighthouseController.ts | useLegacyNavigation": {
|
5826
|
-
"message": "
|
5838
|
+
"message": "Analyze the page using classic Lighthouse when in navigation mode."
|
5827
5839
|
},
|
5828
5840
|
"panels/lighthouse/LighthouseController.ts | webSql": {
|
5829
5841
|
"message": "Web SQL"
|
@@ -4751,6 +4751,12 @@
|
|
4751
4751
|
"panels/elements/EventListenersWidget.ts | showListenersOnTheAncestors": {
|
4752
4752
|
"message": "Ŝh́ôẃ l̂íŝt́êńêŕŝ ón̂ t́ĥé âńĉéŝt́ôŕŝ"
|
4753
4753
|
},
|
4754
|
+
"panels/elements/LayersWidget.ts | cssLayersTitle": {
|
4755
|
+
"message": "ĈŚŜ ĺâýêŕŝ"
|
4756
|
+
},
|
4757
|
+
"panels/elements/LayersWidget.ts | toggleCSSLayers": {
|
4758
|
+
"message": "T̂óĝǵl̂é ĈŚŜ Ĺâýêŕŝ v́îéŵ"
|
4759
|
+
},
|
4754
4760
|
"panels/elements/MarkerDecorator.ts | domBreakpoint": {
|
4755
4761
|
"message": "D̂ÓM̂ B́r̂éâḱp̂óîńt̂"
|
4756
4762
|
},
|
@@ -4832,6 +4838,9 @@
|
|
4832
4838
|
"panels/elements/StylePropertyTreeElement.ts | viewComputedValue": {
|
4833
4839
|
"message": "V̂íêẃ ĉóm̂ṕût́êd́ v̂ál̂úê"
|
4834
4840
|
},
|
4841
|
+
"panels/elements/StylesSidebarPane.ts | clickToRevealLayer": {
|
4842
|
+
"message": "Ĉĺîćk̂ t́ô ŕêv́êál̂ ĺâýêŕ îń l̂áŷér̂ t́r̂éê"
|
4843
|
+
},
|
4835
4844
|
"panels/elements/StylesSidebarPane.ts | constructedStylesheet": {
|
4836
4845
|
"message": "ĉón̂śt̂ŕûćt̂éd̂ śt̂ýl̂éŝh́êét̂"
|
4837
4846
|
},
|
@@ -4886,6 +4895,9 @@
|
|
4886
4895
|
"panels/elements/StylesSidebarPane.ts | invalidString": {
|
4887
4896
|
"message": "{PH1}, p̂ŕôṕêŕt̂ý n̂ám̂é: {PH2}, p̂ŕôṕêŕt̂ý v̂ál̂úê: {PH3}"
|
4888
4897
|
},
|
4898
|
+
"panels/elements/StylesSidebarPane.ts | layer": {
|
4899
|
+
"message": "L̂áŷér̂"
|
4900
|
+
},
|
4889
4901
|
"panels/elements/StylesSidebarPane.ts | newStyleRule": {
|
4890
4902
|
"message": "N̂éŵ Śt̂ýl̂é R̂úl̂é"
|
4891
4903
|
},
|
@@ -5823,7 +5835,7 @@
|
|
5823
5835
|
"message": "T̂ím̂éŝṕâń"
|
5824
5836
|
},
|
5825
5837
|
"panels/lighthouse/LighthouseController.ts | useLegacyNavigation": {
|
5826
|
-
"message": "Â
|
5838
|
+
"message": "Âńâĺŷźê t́ĥé p̂áĝé ûśîńĝ ćl̂áŝśîć L̂íĝh́t̂h́ôúŝé ŵh́êń îń n̂áv̂íĝát̂íôń m̂ód̂é."
|
5827
5839
|
},
|
5828
5840
|
"panels/lighthouse/LighthouseController.ts | webSql": {
|
5829
5841
|
"message": "Ŵéb̂ ŚQ̂Ĺ"
|
@@ -275,6 +275,7 @@ export enum ExperimentName {
|
|
275
275
|
PRECISE_CHANGES = 'preciseChanges',
|
276
276
|
STYLES_PANE_CSS_CHANGES = 'stylesPaneCSSChanges',
|
277
277
|
HEADER_OVERRIDES = 'headerOverrides',
|
278
|
+
CSS_LAYERS = 'cssLayers',
|
278
279
|
}
|
279
280
|
|
280
281
|
// TODO(crbug.com/1167717): Make this a const enum again
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
6
|
+
import type * as Protocol from '../../generated/protocol.js';
|
7
|
+
|
8
|
+
import type {CSSModel} from './CSSModel.js';
|
9
|
+
import {CSSQuery} from './CSSQuery.js';
|
10
|
+
|
11
|
+
export class CSSLayer extends CSSQuery {
|
12
|
+
static parseLayerPayload(cssModel: CSSModel, payload: Protocol.CSS.CSSLayer[]): CSSLayer[] {
|
13
|
+
return payload.map(supports => new CSSLayer(cssModel, supports));
|
14
|
+
}
|
15
|
+
|
16
|
+
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSLayer) {
|
17
|
+
super(cssModel);
|
18
|
+
this.reinitialize(payload);
|
19
|
+
}
|
20
|
+
|
21
|
+
reinitialize(payload: Protocol.CSS.CSSLayer): void {
|
22
|
+
this.text = payload.text;
|
23
|
+
this.range = payload.range ? TextUtils.TextRange.TextRange.fromObject(payload.range) : null;
|
24
|
+
this.styleSheetId = payload.styleSheetId;
|
25
|
+
}
|
26
|
+
|
27
|
+
active(): boolean {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
}
|
@@ -266,6 +266,11 @@ export class CSSModel extends SDKModel<EventTypes> {
|
|
266
266
|
return medias ? CSSMedia.parseMediaArrayPayload(this, medias) : [];
|
267
267
|
}
|
268
268
|
|
269
|
+
async rootLayerPromise(nodeId: Protocol.DOM.NodeId): Promise<Protocol.CSS.CSSLayerData> {
|
270
|
+
const {rootLayer} = await this.agent.invoke_getLayersForNode({nodeId});
|
271
|
+
return rootLayer;
|
272
|
+
}
|
273
|
+
|
269
274
|
isEnabled(): boolean {
|
270
275
|
return this.#isEnabled;
|
271
276
|
}
|
@@ -6,6 +6,7 @@ import * as Protocol from '../../generated/protocol.js';
|
|
6
6
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
7
7
|
|
8
8
|
import {CSSContainerQuery} from './CSSContainerQuery.js';
|
9
|
+
import {CSSLayer} from './CSSLayer.js';
|
9
10
|
import {CSSMedia} from './CSSMedia.js';
|
10
11
|
import {CSSSupports} from './CSSSupports.js';
|
11
12
|
|
@@ -101,6 +102,7 @@ export class CSSStyleRule extends CSSRule {
|
|
101
102
|
media: CSSMedia[];
|
102
103
|
containerQueries: CSSContainerQuery[];
|
103
104
|
supports: CSSSupports[];
|
105
|
+
layers: CSSLayer[];
|
104
106
|
wasUsed: boolean;
|
105
107
|
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
|
106
108
|
// TODO(crbug.com/1011811): Replace with spread operator or better types once Closure is gone.
|
@@ -111,6 +113,7 @@ export class CSSStyleRule extends CSSRule {
|
|
111
113
|
CSSContainerQuery.parseContainerQueriesPayload(cssModel, payload.containerQueries) :
|
112
114
|
[];
|
113
115
|
this.supports = payload.supports ? CSSSupports.parseSupportsPayload(cssModel, payload.supports) : [];
|
116
|
+
this.layers = payload.layers ? CSSLayer.parseLayerPayload(cssModel, payload.layers) : [];
|
114
117
|
this.wasUsed = wasUsed || false;
|
115
118
|
}
|
116
119
|
|
@@ -24,6 +24,7 @@ import * as CPUProfilerModel from './CPUProfilerModel.js';
|
|
24
24
|
import * as CPUThrottlingManager from './CPUThrottlingManager.js';
|
25
25
|
import * as CSSContainerQuery from './CSSContainerQuery.js';
|
26
26
|
import * as CSSFontFace from './CSSFontFace.js';
|
27
|
+
import * as CSSLayer from './CSSLayer.js';
|
27
28
|
import * as CSSMatchedStyles from './CSSMatchedStyles.js';
|
28
29
|
import * as CSSMedia from './CSSMedia.js';
|
29
30
|
import * as CSSMetadata from './CSSMetadata.js';
|
@@ -92,6 +93,7 @@ export {
|
|
92
93
|
CPUThrottlingManager,
|
93
94
|
CSSContainerQuery,
|
94
95
|
CSSFontFace,
|
96
|
+
CSSLayer,
|
95
97
|
CSSMatchedStyles,
|
96
98
|
CSSMedia,
|
97
99
|
CSSMetadata,
|
@@ -42,6 +42,7 @@ import {HTMLFormatter} from './HTMLFormatter.js';
|
|
42
42
|
import {IdentityFormatter} from './IdentityFormatter.js';
|
43
43
|
import {JavaScriptFormatter} from './JavaScriptFormatter.js';
|
44
44
|
import {JSONFormatter} from './JSONFormatter.js';
|
45
|
+
import {computeSubstitution, applySubstitution} from './Substitute.js';
|
45
46
|
|
46
47
|
export interface Chunk {
|
47
48
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
@@ -304,3 +305,5 @@ export function argumentsList(content: string): string[] {
|
|
304
305
|
console.error = (): undefined => undefined;
|
305
306
|
}
|
306
307
|
})();
|
308
|
+
|
309
|
+
export {applySubstitution, computeSubstitution};
|