chrome-devtools-frontend 1.0.934857 → 1.0.936663
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/all_devtools_files.gni +0 -27
- package/config/gni/devtools_grd_files.gni +10 -15
- package/front_end/.eslintrc.js +1 -0
- package/front_end/Tests.js +13 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +15 -6
- package/front_end/core/i18n/locales/en-XL.json +15 -6
- package/front_end/core/sdk/ConsoleModel.ts +0 -20
- package/front_end/entrypoints/devtools_app/devtools_app.json +0 -7
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +1 -1
- package/front_end/entrypoints/inspector_main/module.json +1 -2
- package/front_end/entrypoints/main/MainImpl.ts +10 -3
- package/front_end/entrypoints/node_app/node_app.json +0 -1
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -3
- package/front_end/entrypoints/shell/shell.json +0 -9
- package/front_end/entrypoints/worker_app/worker_app.json +0 -5
- package/front_end/models/issues_manager/IssuesManager.ts +2 -2
- package/front_end/models/issues_manager/{DeprecationIssue.ts → NavigatorUserAgentIssue.ts} +4 -4
- package/front_end/models/issues_manager/issues_manager.ts +2 -2
- package/front_end/panels/application/BackForwardCacheView.ts +54 -6
- package/front_end/panels/application/module.json +0 -5
- package/front_end/panels/console/ConsoleFilter.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +1 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +2 -19
- package/front_end/panels/console/module.json +0 -2
- package/front_end/panels/console_counters/console_counters-meta.ts +0 -3
- package/front_end/panels/coverage/CoverageListView.ts +13 -4
- package/front_end/panels/coverage/module.json +0 -1
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +1 -0
- package/front_end/panels/css_overview/module.json +1 -2
- package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +16 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -0
- package/front_end/panels/elements/components/QueryContainer.ts +1 -0
- package/front_end/panels/elements/module.json +0 -3
- package/front_end/panels/emulation/DeviceModeWrapper.ts +4 -0
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +18 -2
- package/front_end/panels/emulation/module.json +1 -2
- package/front_end/panels/help/help-meta.ts +0 -3
- package/front_end/panels/input/input-meta.ts +0 -2
- package/front_end/panels/media/module.json +0 -1
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -3
- package/front_end/panels/network/module.json +0 -5
- package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -3
- package/front_end/panels/profiler/module.json +1 -3
- package/front_end/panels/profiler/profilesPanel.css +1 -1
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +1 -1
- package/front_end/panels/settings/settings-meta.ts +0 -2
- package/front_end/panels/sources/BreakpointEditDialog.ts +1 -0
- package/front_end/panels/sources/NavigatorView.ts +8 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +15 -0
- package/front_end/panels/sources/module.json +0 -5
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +10 -3
- package/front_end/panels/timeline/module.json +1 -3
- package/front_end/panels/web_audio/web_audio-meta.ts +0 -3
- package/front_end/panels/webauthn/webauthn-meta.ts +0 -2
- package/front_end/ui/components/buttons/button.css +1 -0
- package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -0
- package/front_end/ui/components/text_editor/config.ts +3 -1
- package/front_end/ui/components/text_editor/theme.ts +5 -0
- package/front_end/ui/legacy/TabbedPane.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -1
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +6 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -1
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/CSSLength.ts +10 -3
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +3 -2
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +5 -1
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +4 -2
- package/front_end/ui/legacy/components/inline_editor/cssLength.css +30 -9
- package/front_end/ui/legacy/components/source_frame/module.json +1 -2
- package/front_end/ui/legacy/inspectorCommon.css +2 -12
- package/front_end/ui/legacy/softDropDownButton.css +0 -11
- package/front_end/ui/legacy/themeColors.css +2 -2
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +3 -0
- package/scripts/eslint_rules/lib/ban_a_tags_in_lit_html.js +47 -0
- package/scripts/eslint_rules/tests/ban_a_tags_in_lit_html_test.js +60 -0
- package/front_end/entrypoints/node_main/module.json +0 -8
- package/front_end/panels/console_counters/module.json +0 -5
- package/front_end/panels/developer_resources/module.json +0 -6
- package/front_end/panels/event_listeners/module.json +0 -6
- package/front_end/panels/help/module.json +0 -5
- package/front_end/panels/input/module.json +0 -5
- package/front_end/panels/mobile_throttling/module.json +0 -5
- package/front_end/panels/performance_monitor/module.json +0 -5
- package/front_end/panels/search/module.json +0 -5
- package/front_end/panels/settings/module.json +0 -5
- package/front_end/panels/web_audio/module.json +0 -5
- package/front_end/panels/webauthn/module.json +0 -6
- package/front_end/ui/legacy/components/color_picker/module.json +0 -8
- package/front_end/ui/legacy/components/cookie_table/module.json +0 -9
- package/front_end/ui/legacy/components/data_grid/module.json +0 -8
- package/front_end/ui/legacy/components/inline_editor/module.json +0 -14
- package/front_end/ui/legacy/components/object_ui/module.json +0 -5
|
@@ -7,7 +7,6 @@ import * as ContentSecurityPolicyIssue from './ContentSecurityPolicyIssue.js';
|
|
|
7
7
|
import * as ContrastCheckTrigger from './ContrastCheckTrigger.js';
|
|
8
8
|
import * as CorsIssue from './CorsIssue.js';
|
|
9
9
|
import * as CrossOriginEmbedderPolicyIssue from './CrossOriginEmbedderPolicyIssue.js';
|
|
10
|
-
import * as DeprecationIssue from './DeprecationIssue.js';
|
|
11
10
|
import * as GenericIssue from './GenericIssue.js';
|
|
12
11
|
import * as HeavyAdIssue from './HeavyAdIssue.js';
|
|
13
12
|
import * as Issue from './Issue.js';
|
|
@@ -16,6 +15,7 @@ import * as IssuesManager from './IssuesManager.js';
|
|
|
16
15
|
import * as LowTextContrastIssue from './LowTextContrastIssue.js';
|
|
17
16
|
import * as MarkdownIssueDescription from './MarkdownIssueDescription.js';
|
|
18
17
|
import * as MixedContentIssue from './MixedContentIssue.js';
|
|
18
|
+
import * as NavigatorUserAgentIssue from './NavigatorUserAgentIssue.js';
|
|
19
19
|
import * as QuirksModeIssue from './QuirksModeIssue.js';
|
|
20
20
|
import * as RelatedIssue from './RelatedIssue.js';
|
|
21
21
|
import * as SameSiteCookieIssue from './SameSiteCookieIssue.js';
|
|
@@ -30,7 +30,6 @@ export {
|
|
|
30
30
|
ContrastCheckTrigger,
|
|
31
31
|
CorsIssue,
|
|
32
32
|
CrossOriginEmbedderPolicyIssue,
|
|
33
|
-
DeprecationIssue,
|
|
34
33
|
GenericIssue,
|
|
35
34
|
HeavyAdIssue,
|
|
36
35
|
Issue,
|
|
@@ -39,6 +38,7 @@ export {
|
|
|
39
38
|
LowTextContrastIssue,
|
|
40
39
|
MarkdownIssueDescription,
|
|
41
40
|
MixedContentIssue,
|
|
41
|
+
NavigatorUserAgentIssue,
|
|
42
42
|
QuirksModeIssue,
|
|
43
43
|
RelatedIssue,
|
|
44
44
|
SameSiteCookieIssue,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as Platform from '../../core/platform/platform.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
7
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
9
|
import * as LitHtml from '../../ui/lit-html/lit-html.js';
|
|
9
10
|
import * as ReportView from '../../ui/components/report_view/report_view.js';
|
|
@@ -19,10 +20,6 @@ const UIStrings = {
|
|
|
19
20
|
* @description Title text in Back-forward Cache view of the Application panel
|
|
20
21
|
*/
|
|
21
22
|
mainFrame: 'Main Frame',
|
|
22
|
-
/**
|
|
23
|
-
* @description Section header text in Back-forward Cache view of the Application panel
|
|
24
|
-
*/
|
|
25
|
-
lastMainFrameNavigation: 'Last Main Frame Navigation',
|
|
26
23
|
/**
|
|
27
24
|
* @description Title text in Back-forward Cache view of the Application panel
|
|
28
25
|
*/
|
|
@@ -83,6 +80,10 @@ const UIStrings = {
|
|
|
83
80
|
* of chrome they will not prevent back-forward cache usage anymore.
|
|
84
81
|
*/
|
|
85
82
|
supportPending: 'Pending Support',
|
|
83
|
+
/**
|
|
84
|
+
* @description Button name for showing whether BFCache is available in the pages.
|
|
85
|
+
*/
|
|
86
|
+
runTest: 'Run Test',
|
|
86
87
|
/**
|
|
87
88
|
* @description Explanation for 'pending support' items which prevent the page from being eligible
|
|
88
89
|
* for back-forward cache.
|
|
@@ -131,6 +132,48 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
131
132
|
return this.getMainResourceTreeModel()?.mainFrame || null;
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
private async goBackOneHistoryEntry(): Promise<void> {
|
|
136
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
137
|
+
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
138
|
+
this.goBackOneHistoryEntry, this);
|
|
139
|
+
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
140
|
+
if (!mainTarget) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
144
|
+
if (!resourceTreeModel) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const historyResults = await resourceTreeModel.navigationHistory();
|
|
148
|
+
if (!historyResults) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
resourceTreeModel.navigateToHistoryEntry(historyResults.entries[historyResults.currentIndex - 1]);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private async navigateAwayAndBack(): Promise<void> {
|
|
155
|
+
// Checking BFCache Compatibility
|
|
156
|
+
|
|
157
|
+
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
|
158
|
+
if (!mainTarget) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
162
|
+
|
|
163
|
+
if (resourceTreeModel) {
|
|
164
|
+
// This event is removed by inside of goBackOneHistoryEntry().
|
|
165
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
166
|
+
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
|
|
167
|
+
this.goBackOneHistoryEntry, this);
|
|
168
|
+
|
|
169
|
+
// We can know whether the current page can use BFCache
|
|
170
|
+
// as the browser navigates to another unrelated page and goes back to the current page.
|
|
171
|
+
// We chose "chrome://version" because it must be cross-site.
|
|
172
|
+
// Ideally, We want to have our own testing page like "chrome: //bfcache-test".
|
|
173
|
+
resourceTreeModel.navigate('chrome://version/');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
134
177
|
private renderMainFrameInformation(mainFrame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitHtml.TemplateResult {
|
|
135
178
|
if (!mainFrame) {
|
|
136
179
|
return LitHtml.html`<${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.mainFrame)}</${
|
|
@@ -140,8 +183,13 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
140
183
|
</${ReportView.ReportView.ReportValue.litTagName}>`;
|
|
141
184
|
}
|
|
142
185
|
return LitHtml.html`
|
|
143
|
-
<${ReportView.ReportView.ReportSectionHeader.litTagName}
|
|
144
|
-
|
|
186
|
+
<${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
187
|
+
<${Buttons.Button.Button.litTagName}
|
|
188
|
+
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
189
|
+
@click=${this.navigateAwayAndBack}>
|
|
190
|
+
${i18nString(UIStrings.runTest)}
|
|
191
|
+
</${Buttons.Button.Button.litTagName}>
|
|
192
|
+
</${ReportView.ReportView.ReportSectionHeader.litTagName}>
|
|
145
193
|
<${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.url)}</${
|
|
146
194
|
ReportView.ReportView.ReportKey.litTagName}>
|
|
147
195
|
<${ReportView.ReportView.ReportValue.litTagName}>${mainFrame.url}</${
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": [
|
|
3
3
|
"ui/legacy/components/source_frame",
|
|
4
|
-
"ui/legacy/components/cookie_table",
|
|
5
|
-
"ui/legacy/components/inline_editor",
|
|
6
|
-
"ui/legacy/components/data_grid",
|
|
7
4
|
"ui/legacy",
|
|
8
|
-
"ui/legacy/components/object_ui",
|
|
9
5
|
"ui/legacy/components/perf_ui",
|
|
10
|
-
"panels/mobile_throttling",
|
|
11
6
|
"panels/network",
|
|
12
7
|
"panels/sources"
|
|
13
8
|
]
|
|
@@ -68,7 +68,7 @@ export class ConsoleFilter {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (message.type === SDK.ConsoleModel.FrontendMessageType.Command ||
|
|
71
|
-
message.type === SDK.ConsoleModel.FrontendMessageType.Result) {
|
|
71
|
+
message.type === SDK.ConsoleModel.FrontendMessageType.Result || message.isGroupMessage()) {
|
|
72
72
|
return true;
|
|
73
73
|
}
|
|
74
74
|
if (message.level && !this.levelsMask[message.level as string]) {
|
|
@@ -1057,25 +1057,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
|
|
1059
1059
|
matchesFilterText(filter: string): boolean {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
static recursivelyTestParentConsoleMessage(consoleMessage: SDK.ConsoleModel.ConsoleMessage, filterString: string):
|
|
1065
|
-
boolean {
|
|
1066
|
-
const doesFilterMatchText = consoleMessage.messageText.toLowerCase().includes(filterString.toLowerCase());
|
|
1067
|
-
const doesParentMatchText = consoleMessage.groupParent &&
|
|
1068
|
-
ConsoleViewMessage.recursivelyTestParentConsoleMessage(consoleMessage.groupParent, filterString);
|
|
1069
|
-
return Boolean(doesFilterMatchText || doesParentMatchText);
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
static recursivelyTestChildrenConsoleMessage(consoleMessage: SDK.ConsoleModel.ConsoleMessage, filterString: string):
|
|
1073
|
-
boolean {
|
|
1074
|
-
const doesFilterMatchChildren = consoleMessage.groupChildren?.some(childMessage => {
|
|
1075
|
-
const filterMatch = childMessage.messageText.toLowerCase().includes(filterString.toLowerCase());
|
|
1076
|
-
return filterMatch || ConsoleViewMessage.recursivelyTestChildrenConsoleMessage(childMessage, filterString);
|
|
1077
|
-
});
|
|
1078
|
-
return Boolean(doesFilterMatchChildren);
|
|
1060
|
+
const text = this.contentElement().deepTextContent();
|
|
1061
|
+
return text.toLowerCase().includes(filter.toLowerCase());
|
|
1079
1062
|
}
|
|
1080
1063
|
|
|
1081
1064
|
updateTimestamp(): void {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Root from '../../core/root/root.js';
|
|
6
5
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
@@ -12,8 +11,6 @@ let loadedConsoleCountersModule: (typeof ConsoleCounters|undefined);
|
|
|
12
11
|
|
|
13
12
|
async function loadConsoleCountersModule(): Promise<typeof ConsoleCounters> {
|
|
14
13
|
if (!loadedConsoleCountersModule) {
|
|
15
|
-
// Side-effect import reconsole_counters in module.json
|
|
16
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/console_counters');
|
|
17
14
|
loadedConsoleCountersModule = await import('./console_counters.js');
|
|
18
15
|
}
|
|
19
16
|
return loadedConsoleCountersModule;
|
|
@@ -138,8 +138,8 @@ export class CoverageListView extends UI.Widget.VBox {
|
|
|
138
138
|
this.highlightRegExp = null;
|
|
139
139
|
|
|
140
140
|
const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
|
|
141
|
-
{id: 'url', title: i18nString(UIStrings.url), width: '250px', fixedWidth: false, sortable: true},
|
|
142
|
-
{id: 'type', title: i18nString(UIStrings.type), width: '45px', fixedWidth: true, sortable: true},
|
|
141
|
+
{id: 'url', title: i18nString(UIStrings.url), width: '250px', weight: 3, fixedWidth: false, sortable: true},
|
|
142
|
+
{id: 'type', title: i18nString(UIStrings.type), width: '45px', weight: 1, fixedWidth: true, sortable: true},
|
|
143
143
|
{
|
|
144
144
|
id: 'size',
|
|
145
145
|
title: i18nString(UIStrings.totalBytes),
|
|
@@ -147,6 +147,7 @@ export class CoverageListView extends UI.Widget.VBox {
|
|
|
147
147
|
fixedWidth: true,
|
|
148
148
|
sortable: true,
|
|
149
149
|
align: DataGrid.DataGrid.Align.Right,
|
|
150
|
+
weight: 1,
|
|
150
151
|
},
|
|
151
152
|
{
|
|
152
153
|
id: 'unusedSize',
|
|
@@ -156,9 +157,17 @@ export class CoverageListView extends UI.Widget.VBox {
|
|
|
156
157
|
sortable: true,
|
|
157
158
|
align: DataGrid.DataGrid.Align.Right,
|
|
158
159
|
sort: DataGrid.DataGrid.Order.Descending,
|
|
160
|
+
weight: 1,
|
|
159
161
|
},
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
+
{
|
|
163
|
+
id: 'bars',
|
|
164
|
+
title: i18nString(UIStrings.usageVisualization),
|
|
165
|
+
width: '250px',
|
|
166
|
+
fixedWidth: false,
|
|
167
|
+
sortable: true,
|
|
168
|
+
weight: 1,
|
|
169
|
+
},
|
|
170
|
+
];
|
|
162
171
|
this.dataGrid = new DataGrid.SortableDataGrid.SortableDataGrid<GridNode>({
|
|
163
172
|
displayName: i18nString(UIStrings.codeCoverage),
|
|
164
173
|
columns,
|
|
@@ -106,6 +106,7 @@ export class CSSOverviewStartView extends HTMLElement {
|
|
|
106
106
|
private render(): void {
|
|
107
107
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
108
108
|
// clang-format off
|
|
109
|
+
// eslint-disable-next-line rulesdir/ban_a_tags_in_lit_html
|
|
109
110
|
render(html`
|
|
110
111
|
<div class="css-overview-start-view">
|
|
111
112
|
<h1 class="summary-header">${i18nString(UIStrings.identifyCSSImprovements)}</h1>
|
|
@@ -26,8 +26,6 @@ let loadedDeveloperResourcesModule: (typeof DeveloperResources|undefined);
|
|
|
26
26
|
|
|
27
27
|
async function loadDeveloperResourcesModule(): Promise<typeof DeveloperResources> {
|
|
28
28
|
if (!loadedDeveloperResourcesModule) {
|
|
29
|
-
// Side-effect import resources in module.json
|
|
30
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/developer_resources');
|
|
31
29
|
loadedDeveloperResourcesModule = await import('./developer_resources.js');
|
|
32
30
|
}
|
|
33
31
|
return loadedDeveloperResourcesModule;
|
|
@@ -1049,10 +1049,11 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1049
1049
|
},
|
|
1050
1050
|
]),
|
|
1051
1051
|
TextEditor.Config.baseConfiguration(initialValue),
|
|
1052
|
+
TextEditor.Config.autocompletion,
|
|
1052
1053
|
html(),
|
|
1053
1054
|
TextEditor.Config.domWordWrap,
|
|
1054
1055
|
CodeMirror.EditorView.theme({
|
|
1055
|
-
'
|
|
1056
|
+
'&.cm-editor': {maxHeight: '300px'},
|
|
1056
1057
|
'.cm-scroller': {overflowY: 'auto'},
|
|
1057
1058
|
}),
|
|
1058
1059
|
CodeMirror.EditorView.domEventHandlers({
|
|
@@ -160,6 +160,18 @@ const UIStrings = {
|
|
|
160
160
|
*@description Tooltip text that appears when hovering over the largeicon add button in the Styles Sidebar Pane of the Elements panel
|
|
161
161
|
*/
|
|
162
162
|
newStyleRule: 'New Style Rule',
|
|
163
|
+
/**
|
|
164
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for entering the name of a CSS property in the Styles panel
|
|
165
|
+
*/
|
|
166
|
+
cssPropertyName: '`CSS` property name',
|
|
167
|
+
/**
|
|
168
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for entering the value of a CSS property in the Styles panel
|
|
169
|
+
*/
|
|
170
|
+
cssPropertyValue: '`CSS` property value',
|
|
171
|
+
/**
|
|
172
|
+
*@description Text that is announced by the screen reader when the user focuses on an input field for editing the name of a CSS selector in the Styles panel
|
|
173
|
+
*/
|
|
174
|
+
cssSelector: '`CSS` selector',
|
|
163
175
|
};
|
|
164
176
|
|
|
165
177
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/StylesSidebarPane.ts', UIStrings);
|
|
@@ -1235,6 +1247,7 @@ export class StylePropertiesSection {
|
|
|
1235
1247
|
|
|
1236
1248
|
const selectorContainer = document.createElement('div');
|
|
1237
1249
|
this.selectorElement = document.createElement('span');
|
|
1250
|
+
UI.ARIAUtils.setAccessibleName(this.selectorElement, i18nString(UIStrings.cssSelector));
|
|
1238
1251
|
this.selectorElement.classList.add('selector');
|
|
1239
1252
|
this.selectorElement.textContent = this.headerText();
|
|
1240
1253
|
selectorContainer.appendChild(this.selectorElement);
|
|
@@ -2985,6 +2998,7 @@ export class StylesSidebarPropertyRenderer {
|
|
|
2985
2998
|
|
|
2986
2999
|
renderName(): Element {
|
|
2987
3000
|
const nameElement = document.createElement('span');
|
|
3001
|
+
UI.ARIAUtils.setAccessibleName(nameElement, i18nString(UIStrings.cssPropertyName));
|
|
2988
3002
|
nameElement.className = 'webkit-css-property';
|
|
2989
3003
|
nameElement.textContent = this.propertyName;
|
|
2990
3004
|
nameElement.normalize();
|
|
@@ -2993,6 +3007,7 @@ export class StylesSidebarPropertyRenderer {
|
|
|
2993
3007
|
|
|
2994
3008
|
renderValue(): Element {
|
|
2995
3009
|
const valueElement = document.createElement('span');
|
|
3010
|
+
UI.ARIAUtils.setAccessibleName(valueElement, i18nString(UIStrings.cssPropertyValue));
|
|
2996
3011
|
valueElement.className = 'value';
|
|
2997
3012
|
if (!this.propertyValue) {
|
|
2998
3013
|
return valueElement;
|
|
@@ -3040,7 +3055,7 @@ export class StylesSidebarPropertyRenderer {
|
|
|
3040
3055
|
}
|
|
3041
3056
|
processors.push(this.fontHandler);
|
|
3042
3057
|
}
|
|
3043
|
-
if (this.lengthHandler) {
|
|
3058
|
+
if (Root.Runtime.experiments.isEnabled('cssTypeComponentLength') && this.lengthHandler) {
|
|
3044
3059
|
// TODO(changhaohan): crbug.com/1138628 refactor this to handle unitless 0 cases
|
|
3045
3060
|
regexes.push(InlineEditor.CSSLengthUtils.CSSLengthRegex);
|
|
3046
3061
|
processors.push(this.lengthHandler);
|
|
@@ -286,6 +286,7 @@ export class ElementsBreadcrumbs extends HTMLElement {
|
|
|
286
286
|
crumb: true,
|
|
287
287
|
selected: crumb.selected,
|
|
288
288
|
};
|
|
289
|
+
// eslint-disable-next-line rulesdir/ban_a_tags_in_lit_html
|
|
289
290
|
return LitHtml.html`
|
|
290
291
|
<li class=${LitHtml.Directives.classMap(crumbClasses)}
|
|
291
292
|
data-node-id=${crumb.node.id}
|
|
@@ -56,6 +56,10 @@ export class DeviceModeWrapper extends UI.Widget.VBox {
|
|
|
56
56
|
this.showDeviceModeSetting.set(!this.showDeviceModeSetting.get());
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
isDeviceModeOn(): boolean {
|
|
60
|
+
return this.showDeviceModeSetting.get();
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
captureScreenshot(fullSize?: boolean, clip?: Protocol.Page.Viewport): boolean {
|
|
60
64
|
if (!this.deviceModeView) {
|
|
61
65
|
this.deviceModeView = new DeviceModeView();
|
|
@@ -6,6 +6,7 @@ import type * as Platform from '../../../core/platform/platform.js';
|
|
|
6
6
|
import * as EmulationModel from '../../../models/emulation/emulation.js';
|
|
7
7
|
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
|
8
8
|
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
|
9
|
+
import * as UILegacy from '../../../ui/legacy/legacy.js';
|
|
9
10
|
|
|
10
11
|
class SizeChangedEvent extends Event {
|
|
11
12
|
static readonly eventName = 'sizechanged';
|
|
@@ -14,6 +15,10 @@ class SizeChangedEvent extends Event {
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
function getInputValue(event: Event): number {
|
|
19
|
+
return Number((event.target as HTMLInputElement).value);
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
export class SizeInputElement extends HTMLElement {
|
|
18
23
|
#root = this.attachShadow({mode: 'open'});
|
|
19
24
|
#disabled = false;
|
|
@@ -86,13 +91,24 @@ export class SizeInputElement extends HTMLElement {
|
|
|
86
91
|
placeholder=${this.#placeholder}
|
|
87
92
|
?disabled=${this.#disabled}
|
|
88
93
|
.value=${this.#size}
|
|
89
|
-
@change=${this.fireSizeChange}
|
|
94
|
+
@change=${this.fireSizeChange}
|
|
95
|
+
@keydown=${this.handleModifierKeys} />
|
|
90
96
|
`,
|
|
91
97
|
this.#root, {host: this});
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
private fireSizeChange(event: Event): void {
|
|
95
|
-
this.dispatchEvent(new SizeChangedEvent(
|
|
101
|
+
this.dispatchEvent(new SizeChangedEvent(getInputValue(event)));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private handleModifierKeys(event: Event): void {
|
|
105
|
+
const modifiedValue = UILegacy.UIUtils.modifiedFloatNumber(getInputValue(event), event);
|
|
106
|
+
if (modifiedValue === null) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
(event.target as HTMLInputElement).value = String(modifiedValue);
|
|
96
112
|
}
|
|
97
113
|
}
|
|
98
114
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
-
import * as Root from '../../core/root/root.js';
|
|
8
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
8
|
|
|
10
9
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
@@ -51,8 +50,6 @@ let loadedHelpModule: (typeof Help|undefined);
|
|
|
51
50
|
|
|
52
51
|
async function loadHelpModule(): Promise<typeof Help> {
|
|
53
52
|
if (!loadedHelpModule) {
|
|
54
|
-
// Side-effect import resources in module.json
|
|
55
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/help');
|
|
56
53
|
loadedHelpModule = await import('./help.js');
|
|
57
54
|
}
|
|
58
55
|
return loadedHelpModule;
|
|
@@ -46,8 +46,6 @@ let loadedInputModule: (typeof Input|undefined);
|
|
|
46
46
|
|
|
47
47
|
async function loadInputModule(): Promise<typeof Input> {
|
|
48
48
|
if (!loadedInputModule) {
|
|
49
|
-
// Side-effect import resources in module.json
|
|
50
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/input');
|
|
51
49
|
loadedInputModule = await import('./input.js');
|
|
52
50
|
}
|
|
53
51
|
return loadedInputModule;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
-
import * as Root from '../../core/root/root.js';
|
|
8
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
8
|
|
|
10
9
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
@@ -53,8 +52,6 @@ let loadedMobileThrottlingModule: (typeof MobileThrottling|undefined);
|
|
|
53
52
|
|
|
54
53
|
async function loadMobileThrottlingModule(): Promise<typeof MobileThrottling> {
|
|
55
54
|
if (!loadedMobileThrottlingModule) {
|
|
56
|
-
// Side-effect import resources in module.json
|
|
57
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/mobile_throttling');
|
|
58
55
|
loadedMobileThrottlingModule = await import('./mobile_throttling.js');
|
|
59
56
|
}
|
|
60
57
|
return loadedMobileThrottlingModule;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": [
|
|
3
|
-
"ui/legacy/components/cookie_table",
|
|
4
|
-
"ui/legacy/components/data_grid",
|
|
5
|
-
"panels/mobile_throttling",
|
|
6
|
-
"ui/legacy/components/object_ui",
|
|
7
3
|
"ui/legacy/components/perf_ui",
|
|
8
|
-
"panels/search",
|
|
9
4
|
"ui/legacy/components/source_frame",
|
|
10
5
|
"ui/legacy"
|
|
11
6
|
]
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
8
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
@@ -47,8 +46,6 @@ let loadedPerformanceMonitorModule: (typeof PerformanceMonitor|undefined);
|
|
|
47
46
|
|
|
48
47
|
async function loadPerformanceMonitorModule(): Promise<typeof PerformanceMonitor> {
|
|
49
48
|
if (!loadedPerformanceMonitorModule) {
|
|
50
|
-
// Side-effect import resources in module.json
|
|
51
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/performance_monitor');
|
|
52
49
|
loadedPerformanceMonitorModule = await import('./performance_monitor.js');
|
|
53
50
|
}
|
|
54
51
|
return loadedPerformanceMonitorModule;
|
|
@@ -61,8 +61,6 @@ let loadedSettingsModule: (typeof Settings|undefined);
|
|
|
61
61
|
|
|
62
62
|
async function loadSettingsModule(): Promise<typeof Settings> {
|
|
63
63
|
if (!loadedSettingsModule) {
|
|
64
|
-
// Side-effect import resources in module.json
|
|
65
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/settings');
|
|
66
64
|
loadedSettingsModule = await import('./settings.js');
|
|
67
65
|
}
|
|
68
66
|
return loadedSettingsModule;
|
|
@@ -71,6 +71,7 @@ export class BreakpointEditDialog extends UI.Widget.Widget {
|
|
|
71
71
|
const editorConfig = [
|
|
72
72
|
(await CodeMirror.javascript()).javascriptLanguage,
|
|
73
73
|
TextEditor.Config.baseConfiguration(oldCondition || ''),
|
|
74
|
+
TextEditor.Config.autocompletion,
|
|
74
75
|
CodeMirror.EditorView.lineWrapping,
|
|
75
76
|
TextEditor.Config.showCompletionHint,
|
|
76
77
|
await TextEditor.JavaScript.completion(),
|
|
@@ -782,8 +782,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
782
782
|
this.rename(node, false);
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
private handleContextMenuExclude(project: Workspace.Workspace.Project, path: string): void {
|
|
786
|
-
const shouldExclude =
|
|
785
|
+
private async handleContextMenuExclude(project: Workspace.Workspace.Project, path: string): Promise<void> {
|
|
786
|
+
const shouldExclude = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToExcludeThis));
|
|
787
787
|
if (shouldExclude) {
|
|
788
788
|
UI.UIUtils.startBatchUpdate();
|
|
789
789
|
project.excludeFolder(
|
|
@@ -792,8 +792,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
private handleContextMenuDelete(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
|
|
796
|
-
const shouldDelete =
|
|
795
|
+
private async handleContextMenuDelete(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<void> {
|
|
796
|
+
const shouldDelete = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToDeleteThis));
|
|
797
797
|
if (shouldDelete) {
|
|
798
798
|
uiSourceCode.project().deleteFile(uiSourceCode);
|
|
799
799
|
}
|
|
@@ -816,8 +816,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
816
816
|
contextMenu.show();
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
private handleDeleteOverrides(node: NavigatorTreeNode): void {
|
|
820
|
-
const shouldRemove =
|
|
819
|
+
private async handleDeleteOverrides(node: NavigatorTreeNode): Promise<void> {
|
|
820
|
+
const shouldRemove = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToDeleteAll));
|
|
821
821
|
if (shouldRemove) {
|
|
822
822
|
this.handleDeleteOverridesHelper(node);
|
|
823
823
|
}
|
|
@@ -871,8 +871,8 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
871
871
|
if (project.type() === Workspace.Workspace.projectTypes.FileSystem) {
|
|
872
872
|
contextMenu.defaultSection().appendAction('sources.add-folder-to-workspace', undefined, true);
|
|
873
873
|
if (node instanceof NavigatorGroupTreeNode) {
|
|
874
|
-
contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeFolderFromWorkspace), () => {
|
|
875
|
-
const shouldRemove =
|
|
874
|
+
contextMenu.defaultSection().appendItem(i18nString(UIStrings.removeFolderFromWorkspace), async () => {
|
|
875
|
+
const shouldRemove = await UI.UIUtils.ConfirmDialog.show(i18nString(UIStrings.areYouSureYouWantToRemoveThis));
|
|
876
876
|
if (shouldRemove) {
|
|
877
877
|
project.remove();
|
|
878
878
|
}
|