chrome-devtools-frontend 1.0.927127 → 1.0.928589
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/AUTHORS +1 -0
- package/config/gni/all_devtools_files.gni +0 -1
- package/config/gni/devtools_grd_files.gni +30 -4
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_preview_feature.svg +3 -0
- package/front_end/Tests.js +2 -3
- package/front_end/core/common/Settings.ts +26 -45
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/locales/en-US.json +60 -15
- package/front_end/core/i18n/locales/en-XL.json +60 -15
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +62 -61
- package/front_end/core/sdk/AccessibilityModel.ts +73 -73
- package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
- package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
- package/front_end/core/sdk/CSSFontFace.ts +10 -10
- package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSMetadata.ts +53 -49
- package/front_end/core/sdk/CSSModel.ts +139 -135
- package/front_end/core/sdk/CSSProperty.ts +18 -18
- package/front_end/core/sdk/CSSRule.ts +15 -15
- package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
- package/front_end/core/sdk/ChildTargetManager.ts +41 -40
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
- package/front_end/core/sdk/Connections.ts +81 -81
- package/front_end/core/sdk/ConsoleModel.ts +68 -68
- package/front_end/core/sdk/Cookie.ts +48 -48
- package/front_end/core/sdk/CookieModel.ts +13 -13
- package/front_end/core/sdk/CookieParser.ts +45 -45
- package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
- package/front_end/core/sdk/DOMModel.ts +264 -252
- package/front_end/core/sdk/DebuggerModel.ts +209 -205
- package/front_end/core/sdk/EmulationModel.ts +76 -76
- package/front_end/core/sdk/FilmStripModel.ts +29 -29
- package/front_end/core/sdk/FrameManager.ts +43 -42
- package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
- package/front_end/core/sdk/IsolateManager.ts +82 -82
- package/front_end/core/sdk/IssuesModel.ts +6 -6
- package/front_end/core/sdk/LayerTreeBase.ts +37 -37
- package/front_end/core/sdk/LogModel.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +229 -225
- package/front_end/core/sdk/NetworkRequest.ts +368 -360
- package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
- package/front_end/core/sdk/OverlayModel.ts +155 -153
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
- package/front_end/core/sdk/PageResourceLoader.ts +30 -30
- package/front_end/core/sdk/PaintProfiler.ts +16 -16
- package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
- package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
- package/front_end/core/sdk/RemoteObject.ts +108 -104
- package/front_end/core/sdk/Resource.ts +85 -84
- package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
- package/front_end/core/sdk/RuntimeModel.ts +38 -34
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
- package/front_end/core/sdk/Script.ts +29 -29
- package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
- package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
- package/front_end/core/sdk/SourceMap.ts +40 -36
- package/front_end/core/sdk/SourceMapManager.ts +57 -57
- package/front_end/core/sdk/Target.ts +64 -63
- package/front_end/core/sdk/TargetManager.ts +60 -56
- package/front_end/core/sdk/TracingManager.ts +39 -39
- package/front_end/core/sdk/TracingModel.ts +125 -125
- package/front_end/core/sdk/WebAuthnModel.ts +9 -9
- package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
- package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
- package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/GenericIssue.ts +86 -0
- package/front_end/models/issues_manager/Issue.ts +24 -0
- package/front_end/models/issues_manager/IssuesManager.ts +18 -6
- package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
- package/front_end/panels/console/ConsoleSidebar.ts +0 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
- package/front_end/panels/elements/components/LayoutPane.ts +5 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
- package/front_end/panels/issues/IssueAggregator.ts +16 -0
- package/front_end/panels/issues/IssueKindView.ts +95 -0
- package/front_end/panels/issues/IssueView.ts +6 -0
- package/front_end/panels/issues/IssuesPane.ts +81 -18
- package/front_end/panels/issues/issuesTree.css +8 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -0
- package/front_end/panels/settings/settingsScreen.css +24 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +22 -7
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
- package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
- package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
- package/front_end/ui/components/docs/text_editor/basic.html +28 -0
- package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
- package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
- package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
- package/front_end/ui/components/text_editor/config.ts +264 -0
- package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
- package/front_end/ui/components/text_editor/theme.ts +113 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
- package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
- package/front_end/ui/legacy/ARIAUtils.ts +14 -11
- package/front_end/ui/legacy/TabbedPane.ts +32 -3
- package/front_end/ui/legacy/UIUtils.ts +3 -1
- package/front_end/ui/legacy/View.ts +6 -0
- package/front_end/ui/legacy/ViewManager.ts +5 -1
- package/front_end/ui/legacy/ViewRegistration.ts +5 -0
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +6 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/tabbedPane.css +24 -0
- package/front_end/ui/legacy/toolbar.css +5 -0
- package/inspector_overlay/main.ts +2 -1
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +9 -0
- package/scripts/migration/class-fields/migrate.js +56 -0
- package/scripts/migration/class-fields/package.json +5 -0
- package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
- package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Copyright 2021 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
|
+
|
|
1
5
|
/*
|
|
2
6
|
* Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
|
|
3
7
|
* Copyright (C) 2010 Joseph Pecoraro. All rights reserved.
|
|
@@ -13,7 +17,7 @@
|
|
|
13
17
|
* copyright notice, this list of conditions and the following disclaimer
|
|
14
18
|
* in the documentation and/or other materials provided with the
|
|
15
19
|
* distribution.
|
|
16
|
-
* * Neither the name of Google Inc. nor the names of its
|
|
20
|
+
* * Neither the #name of Google Inc. nor the names of its
|
|
17
21
|
* contributors may be used to endorse or promote products derived from
|
|
18
22
|
* this software without specific prior written permission.
|
|
19
23
|
*
|
|
@@ -35,58 +39,58 @@ import * as Common from '../common/common.js';
|
|
|
35
39
|
import * as Platform from '../platform/platform.js';
|
|
36
40
|
|
|
37
41
|
export class CSSMetadata {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
readonly #values: string[];
|
|
43
|
+
readonly #longhands: Map<string, string[]>;
|
|
44
|
+
readonly #shorthands: Map<string, string[]>;
|
|
45
|
+
readonly #inherited: Set<string>;
|
|
46
|
+
readonly #svgProperties: Set<string>;
|
|
47
|
+
readonly #propertyValues: Map<string, string[]>;
|
|
48
|
+
readonly #aliasesFor: Map<string, string>;
|
|
49
|
+
#valuesSet: Set<string>;
|
|
50
|
+
readonly #nameValuePresetsInternal: string[];
|
|
51
|
+
readonly #nameValuePresetsIncludingSVG: string[];
|
|
48
52
|
|
|
49
53
|
constructor(properties: CSSPropertyDefinition[], aliasesFor: Map<string, string>) {
|
|
50
|
-
this
|
|
51
|
-
this
|
|
52
|
-
this
|
|
53
|
-
this
|
|
54
|
-
this
|
|
55
|
-
this
|
|
56
|
-
this
|
|
54
|
+
this.#values = [];
|
|
55
|
+
this.#longhands = new Map();
|
|
56
|
+
this.#shorthands = new Map();
|
|
57
|
+
this.#inherited = new Set();
|
|
58
|
+
this.#svgProperties = new Set();
|
|
59
|
+
this.#propertyValues = new Map();
|
|
60
|
+
this.#aliasesFor = aliasesFor;
|
|
57
61
|
for (let i = 0; i < properties.length; ++i) {
|
|
58
62
|
const property = properties[i];
|
|
59
63
|
const propertyName = property.name;
|
|
60
64
|
if (!CSS.supports(propertyName, 'initial')) {
|
|
61
65
|
continue;
|
|
62
66
|
}
|
|
63
|
-
this
|
|
67
|
+
this.#values.push(propertyName);
|
|
64
68
|
|
|
65
69
|
if (property.inherited) {
|
|
66
|
-
this
|
|
70
|
+
this.#inherited.add(propertyName);
|
|
67
71
|
}
|
|
68
72
|
if (property.svg) {
|
|
69
|
-
this
|
|
73
|
+
this.#svgProperties.add(propertyName);
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
const longhands = properties[i].longhands;
|
|
73
77
|
if (longhands) {
|
|
74
|
-
this
|
|
78
|
+
this.#longhands.set(propertyName, longhands);
|
|
75
79
|
for (let j = 0; j < longhands.length; ++j) {
|
|
76
80
|
const longhandName = longhands[j];
|
|
77
|
-
let shorthands = this
|
|
81
|
+
let shorthands = this.#shorthands.get(longhandName);
|
|
78
82
|
if (!shorthands) {
|
|
79
83
|
shorthands = [];
|
|
80
|
-
this
|
|
84
|
+
this.#shorthands.set(longhandName, shorthands);
|
|
81
85
|
}
|
|
82
86
|
shorthands.push(propertyName);
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
|
-
this
|
|
87
|
-
this
|
|
90
|
+
this.#values.sort(CSSMetadata.sortPrefixesToEnd);
|
|
91
|
+
this.#valuesSet = new Set(this.#values);
|
|
88
92
|
|
|
89
|
-
// Reads in auto-generated property names and values from blink/public/renderer/core/css/css_properties.json5
|
|
93
|
+
// Reads in auto-generated property names and #values from blink/public/renderer/core/css/css_properties.json5
|
|
90
94
|
// treats _generatedPropertyValues as basis
|
|
91
95
|
const propertyValueSets = new Map<string, Set<string>>();
|
|
92
96
|
for (const [propertyName, basisValueObj] of Object.entries(SupportedCSSProperties.generatedPropertyValues)) {
|
|
@@ -101,7 +105,7 @@ export class CSSMetadata {
|
|
|
101
105
|
propertyValueSets.set(propertyName, new Set(extraValueObj.values));
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
// finally add common keywords to value sets and convert property values
|
|
108
|
+
// finally add common keywords to value sets and convert property #values
|
|
105
109
|
// into arrays since callers expect arrays
|
|
106
110
|
for (const [propertyName, values] of propertyValueSets) {
|
|
107
111
|
for (const commonKeyword of CommonKeywords) {
|
|
@@ -110,20 +114,20 @@ export class CSSMetadata {
|
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
this
|
|
117
|
+
this.#propertyValues.set(propertyName, [...values]);
|
|
114
118
|
}
|
|
115
119
|
|
|
116
|
-
this
|
|
117
|
-
this
|
|
118
|
-
for (const name of this
|
|
120
|
+
this.#nameValuePresetsInternal = [];
|
|
121
|
+
this.#nameValuePresetsIncludingSVG = [];
|
|
122
|
+
for (const name of this.#valuesSet) {
|
|
119
123
|
const values = this.specificPropertyValues(name)
|
|
120
124
|
.filter(value => CSS.supports(name, value))
|
|
121
125
|
.sort(CSSMetadata.sortPrefixesToEnd);
|
|
122
126
|
const presets = values.map(value => `${name}: ${value}`);
|
|
123
127
|
if (!this.isSVGProperty(name)) {
|
|
124
|
-
this
|
|
128
|
+
this.#nameValuePresetsInternal.push(...presets);
|
|
125
129
|
}
|
|
126
|
-
this
|
|
130
|
+
this.#nameValuePresetsIncludingSVG.push(...presets);
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
@@ -140,24 +144,24 @@ export class CSSMetadata {
|
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
allProperties(): string[] {
|
|
143
|
-
return this
|
|
147
|
+
return this.#values;
|
|
144
148
|
}
|
|
145
149
|
|
|
146
150
|
nameValuePresets(includeSVG?: boolean): string[] {
|
|
147
|
-
return includeSVG ? this
|
|
151
|
+
return includeSVG ? this.#nameValuePresetsIncludingSVG : this.#nameValuePresetsInternal;
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
isSVGProperty(name: string): boolean {
|
|
151
155
|
name = name.toLowerCase();
|
|
152
|
-
return this
|
|
156
|
+
return this.#svgProperties.has(name);
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
getLonghands(shorthand: string): string[]|null {
|
|
156
|
-
return this
|
|
160
|
+
return this.#longhands.get(shorthand) || null;
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
getShorthands(longhand: string): string[]|null {
|
|
160
|
-
return this
|
|
164
|
+
return this.#shorthands.get(longhand) || null;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
isColorAwareProperty(propertyName: string): boolean {
|
|
@@ -212,7 +216,7 @@ export class CSSMetadata {
|
|
|
212
216
|
isStringProperty(propertyName: string): boolean {
|
|
213
217
|
propertyName = propertyName.toLowerCase();
|
|
214
218
|
// TODO(crbug.com/1033910): Generalize this to all CSS properties
|
|
215
|
-
// that accept <string> values.
|
|
219
|
+
// that accept <string> #values.
|
|
216
220
|
return propertyName === 'content';
|
|
217
221
|
}
|
|
218
222
|
|
|
@@ -222,7 +226,7 @@ export class CSSMetadata {
|
|
|
222
226
|
}
|
|
223
227
|
name = name.toLowerCase();
|
|
224
228
|
|
|
225
|
-
const aliasFor = this
|
|
229
|
+
const aliasFor = this.#aliasesFor.get(name);
|
|
226
230
|
if (aliasFor) {
|
|
227
231
|
return aliasFor;
|
|
228
232
|
}
|
|
@@ -231,7 +235,7 @@ export class CSSMetadata {
|
|
|
231
235
|
return name;
|
|
232
236
|
}
|
|
233
237
|
const match = name.match(/(?:-webkit-)(.+)/);
|
|
234
|
-
if (!match || !this
|
|
238
|
+
if (!match || !this.#valuesSet.has(match[1])) {
|
|
235
239
|
return name;
|
|
236
240
|
}
|
|
237
241
|
return match[1];
|
|
@@ -243,19 +247,19 @@ export class CSSMetadata {
|
|
|
243
247
|
propertyName.startsWith('-ms-') || propertyName.startsWith('-o-') || propertyName.startsWith('-webkit-')) {
|
|
244
248
|
return true;
|
|
245
249
|
}
|
|
246
|
-
return this
|
|
250
|
+
return this.#valuesSet.has(propertyName);
|
|
247
251
|
}
|
|
248
252
|
|
|
249
253
|
isPropertyInherited(propertyName: string): boolean {
|
|
250
254
|
propertyName = propertyName.toLowerCase();
|
|
251
|
-
return propertyName.startsWith('--') || this
|
|
252
|
-
this
|
|
255
|
+
return propertyName.startsWith('--') || this.#inherited.has(this.canonicalPropertyName(propertyName)) ||
|
|
256
|
+
this.#inherited.has(propertyName);
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
private specificPropertyValues(propertyName: string): string[] {
|
|
256
260
|
const unprefixedName = propertyName.replace(/^-webkit-/, '');
|
|
257
|
-
const propertyValues = this
|
|
258
|
-
// propertyValues acts like cache; missing properties are added with possible common keywords
|
|
261
|
+
const propertyValues = this.#propertyValues;
|
|
262
|
+
// #propertyValues acts like cache; missing properties are added with possible common keywords
|
|
259
263
|
let keywords: (string[]|undefined) = propertyValues.get(propertyName) || propertyValues.get(unprefixedName);
|
|
260
264
|
if (!keywords) {
|
|
261
265
|
keywords = [];
|
|
@@ -318,7 +322,7 @@ export const URLRegex = /url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g;
|
|
|
318
322
|
* "a a ."
|
|
319
323
|
*
|
|
320
324
|
* 'grid', 'grid-template', e.g.
|
|
321
|
-
* [track
|
|
325
|
+
* [track-#name] "a a ." minmax(50px, auto) [track-#name]
|
|
322
326
|
*/
|
|
323
327
|
export const GridAreaRowRegex = /((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;
|
|
324
328
|
|
|
@@ -494,7 +498,7 @@ const angleAwareProperties = new Set<string>([
|
|
|
494
498
|
'font-style',
|
|
495
499
|
]);
|
|
496
500
|
|
|
497
|
-
// manually maintained list of property values to add into autocomplete list
|
|
501
|
+
// manually maintained list of property #values to add into autocomplete list
|
|
498
502
|
const extraPropertyValues = {
|
|
499
503
|
'background-repeat': {values: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']},
|
|
500
504
|
'content': {values: ['normal', 'close-quote', 'no-close-quote', 'no-open-quote', 'open-quote']},
|