chrome-devtools-frontend 1.0.939473 → 1.0.941208
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 -7
- package/config/gni/devtools_grd_files.gni +7 -1
- package/config/gni/devtools_image_files.gni +1 -0
- package/docs/triage_guidelines.md +3 -3
- package/front_end/.eslintrc.js +1 -0
- package/front_end/Images/src/feedback_button_icon.svg +3 -0
- package/front_end/Tests.js +14 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -0
- package/front_end/core/host/UserMetrics.ts +71 -0
- package/front_end/core/i18n/locales/en-US.json +30 -9
- package/front_end/core/i18n/locales/en-XL.json +30 -9
- package/front_end/core/sdk/DOMDebuggerModel.ts +18 -1
- package/front_end/devtools_compatibility.js +5 -0
- package/front_end/entrypoints/main/MainImpl.ts +6 -3
- package/front_end/entrypoints/main/main-meta.ts +1 -0
- package/front_end/entrypoints/shell/shell.json +0 -1
- package/front_end/global_typings/global_defs.d.ts +5 -0
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +14 -2
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +9 -0
- package/front_end/models/logs/LogManager.ts +1 -0
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +1 -1
- package/front_end/panels/application/BackForwardCacheView.ts +24 -24
- package/front_end/panels/application/module.json +0 -1
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +6 -8
- package/front_end/panels/css_overview/components/cssOverviewStartView.css +7 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -1
- package/front_end/panels/issues/IssueKindView.ts +22 -4
- package/front_end/panels/layer_viewer/module.json +1 -2
- package/front_end/panels/lighthouse/LighthouseController.ts +10 -33
- package/front_end/panels/lighthouse/LighthousePanel.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +2 -1
- package/front_end/panels/media/module.json +1 -2
- package/front_end/panels/network/NetworkLogView.ts +3 -0
- package/front_end/panels/network/module.json +0 -1
- package/front_end/panels/profiler/module.json +1 -2
- package/front_end/panels/settings/components/SyncSection.ts +25 -4
- package/front_end/panels/sources/SourcesPanel.ts +9 -5
- package/front_end/panels/timeline/module.json +0 -1
- package/front_end/third_party/codemirror.next/bundle-tsconfig.json +1 -1
- package/front_end/ui/components/buttons/Button.ts +11 -0
- package/front_end/ui/components/buttons/button.css +4 -0
- package/front_end/ui/components/docs/button/basic.ts +10 -0
- package/front_end/ui/components/docs/panel_feedback/basic.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/basic.ts +20 -0
- package/front_end/ui/components/docs/panel_feedback/button.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/button.ts +18 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +1 -0
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +67 -0
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +100 -0
- package/front_end/ui/components/panel_feedback/panelFeedback.css +76 -0
- package/front_end/ui/components/panel_feedback/panel_feedback.ts +6 -0
- package/front_end/ui/components/report_view/reportValue.css +1 -0
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -1
- package/front_end/ui/legacy/softContextMenu.css +1 -0
- package/front_end/ui/legacy/utils/append-style.ts +9 -4
- package/package.json +2 -2
- package/scripts/build/generate_css_js_files.js +23 -9
- package/scripts/build/ninja/generate_css.gni +10 -1
- package/scripts/eslint_rules/lib/check_css_import.js +2 -2
- package/scripts/eslint_rules/tests/check_css_import_test.js +12 -0
- package/front_end/ui/legacy/components/perf_ui/module.json +0 -13
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
found in the LICENSE file.
|
|
5
|
+
-->
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width" />
|
|
11
|
+
<title>Feedback button</title>
|
|
12
|
+
<style>
|
|
13
|
+
#container {
|
|
14
|
+
width: 80%;
|
|
15
|
+
border: 1px solid black;
|
|
16
|
+
padding: 10px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="container">
|
|
22
|
+
</div>
|
|
23
|
+
<script type="module" src="./button.js"></script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
|
|
5
|
+
import * as FrontendHelpers from '../../../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
|
|
6
|
+
import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
|
|
7
|
+
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
+
|
|
9
|
+
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
+
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
+
|
|
12
|
+
const component = new PanelFeedback.FeedbackButton.FeedbackButton();
|
|
13
|
+
|
|
14
|
+
component.data = {
|
|
15
|
+
feedbackUrl: 'https://www.example.com',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
document.getElementById('container')?.appendChild(component);
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
8
|
+
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
9
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
10
|
+
|
|
11
|
+
const UIStrings = {
|
|
12
|
+
/**
|
|
13
|
+
* @description The title of the button that leads to the feedback form.
|
|
14
|
+
*/
|
|
15
|
+
feedback: 'Feedback',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/panel_feedback/FeedbackButton.ts', UIStrings);
|
|
19
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
|
+
|
|
21
|
+
const feedbackIconUrl = new URL('../../../Images/feedback_button_icon.svg', import.meta.url).toString();
|
|
22
|
+
|
|
23
|
+
export interface FeedbackButtonData {
|
|
24
|
+
feedbackUrl: string;
|
|
25
|
+
}
|
|
26
|
+
export class FeedbackButton extends HTMLElement {
|
|
27
|
+
static readonly litTagName = LitHtml.literal`devtools-feedback-button`;
|
|
28
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
29
|
+
readonly #boundRender = this.render.bind(this);
|
|
30
|
+
|
|
31
|
+
#props: FeedbackButtonData = {
|
|
32
|
+
feedbackUrl: '',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
set data(data: FeedbackButtonData) {
|
|
36
|
+
this.#props = data;
|
|
37
|
+
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#onFeedbackClick(): void {
|
|
41
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(this.#props.feedbackUrl);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private render(): void {
|
|
45
|
+
if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {
|
|
46
|
+
throw new Error('FeedbackButton render was not scheduled');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// clang-format off
|
|
50
|
+
LitHtml.render(LitHtml.html`
|
|
51
|
+
<${Buttons.Button.Button.litTagName}
|
|
52
|
+
@click=${this.#onFeedbackClick}
|
|
53
|
+
.iconUrl=${feedbackIconUrl}
|
|
54
|
+
.variant=${Buttons.Button.Variant.SECONDARY}
|
|
55
|
+
>${i18nString(UIStrings.feedback)}</${Buttons.Button.Button.litTagName}>
|
|
56
|
+
`, this.#shadow, {host: this});
|
|
57
|
+
// clang-format on
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-feedback-button', FeedbackButton);
|
|
62
|
+
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'devtools-feedback-button': FeedbackButton;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
|
|
5
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
+
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
7
|
+
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
8
|
+
import * as IconButton from '../icon_button/icon_button.js';
|
|
9
|
+
|
|
10
|
+
import panelFeedbackStyles from './panelFeedback.css.js';
|
|
11
|
+
|
|
12
|
+
const UIStrings = {
|
|
13
|
+
/**
|
|
14
|
+
*@description Introduction sentence to convey the feature is being actively worked on and we are looking for feedback.
|
|
15
|
+
*/
|
|
16
|
+
previewText: 'Our team is actively working on this feature and we would love to know what you think.',
|
|
17
|
+
/**
|
|
18
|
+
*@description Link text the user can click to provide feedback to the team.
|
|
19
|
+
*/
|
|
20
|
+
previewTextFeedbackLink: 'Send us your feedback.',
|
|
21
|
+
/**
|
|
22
|
+
*@description Title of the UI section that shows the user that this feature is in preview. Used as the main heading. Not a verb.
|
|
23
|
+
*/
|
|
24
|
+
previewFeature: 'Preview feature',
|
|
25
|
+
/**
|
|
26
|
+
*@description Title of the section to the quick start video and documentation on experimental panels.
|
|
27
|
+
*/
|
|
28
|
+
videoAndDocumentation: 'Video and documentation',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/panel_feedback/PanelFeedback.ts', UIStrings);
|
|
32
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
33
|
+
|
|
34
|
+
const previewFeatureUrl = new URL('../../../Images/ic_preview_feature.svg', import.meta.url).toString();
|
|
35
|
+
const videoThumbnailUrl = new URL('../../../Images/preview_feature_video_thumbnail.svg', import.meta.url).toString();
|
|
36
|
+
|
|
37
|
+
export interface PanelFeedbackData {
|
|
38
|
+
feedbackUrl: string;
|
|
39
|
+
quickStartUrl: string;
|
|
40
|
+
quickStartLinkText: string;
|
|
41
|
+
}
|
|
42
|
+
export class PanelFeedback extends HTMLElement {
|
|
43
|
+
static readonly litTagName = LitHtml.literal`devtools-panel-feedback`;
|
|
44
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
45
|
+
readonly #boundRender = this.render.bind(this);
|
|
46
|
+
|
|
47
|
+
#props: PanelFeedbackData = {
|
|
48
|
+
feedbackUrl: '',
|
|
49
|
+
quickStartUrl: '',
|
|
50
|
+
quickStartLinkText: '',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
connectedCallback(): void {
|
|
54
|
+
this.#shadow.adoptedStyleSheets = [panelFeedbackStyles];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set data(data: PanelFeedbackData) {
|
|
58
|
+
this.#props = data;
|
|
59
|
+
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private render(): void {
|
|
63
|
+
if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {
|
|
64
|
+
throw new Error('PanelFeedback render was not scheduled');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// clang-format off
|
|
68
|
+
LitHtml.render(LitHtml.html`
|
|
69
|
+
<div class="preview">
|
|
70
|
+
<h2 class="flex">
|
|
71
|
+
<${IconButton.Icon.Icon.litTagName} .data=${{
|
|
72
|
+
iconPath: previewFeatureUrl,
|
|
73
|
+
width: '24px',
|
|
74
|
+
height: '24px',
|
|
75
|
+
color: 'var(--color-primary)',
|
|
76
|
+
} as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}> ${i18nString(UIStrings.previewFeature)}
|
|
77
|
+
</h2>
|
|
78
|
+
<p>${i18nString(UIStrings.previewText)} <x-link href=${this.#props.feedbackUrl}>${i18nString(UIStrings.previewTextFeedbackLink)}</x-link></p>
|
|
79
|
+
<div class="video">
|
|
80
|
+
<div class="thumbnail">
|
|
81
|
+
<img src=${videoThumbnailUrl} role="presentation" />
|
|
82
|
+
</div>
|
|
83
|
+
<div class="video-description">
|
|
84
|
+
<h3>${i18nString(UIStrings.videoAndDocumentation)}</h3>
|
|
85
|
+
<x-link class="quick-start-link" href=${this.#props.quickStartUrl}>${this.#props.quickStartLinkText}</x-link>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
`, this.#shadow, {host: this});
|
|
90
|
+
// clang-format on
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-panel-feedback', PanelFeedback);
|
|
95
|
+
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
'devtools-panel-feedback': PanelFeedback;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright 2021 Google LLC. All rights reserved.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.preview {
|
|
16
|
+
padding: 12px 16px;
|
|
17
|
+
border: 1px solid var(--color-details-hairline);
|
|
18
|
+
color: var(--color-text-primary);
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
line-height: 20px;
|
|
21
|
+
border-radius: 12px;
|
|
22
|
+
margin: 42px 0;
|
|
23
|
+
letter-spacing: 0.01em;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
h2 {
|
|
27
|
+
color: var(--color-primary);
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
line-height: 20px;
|
|
30
|
+
letter-spacing: 0.01em;
|
|
31
|
+
margin: 9px 0 14px;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 5px;
|
|
35
|
+
font-weight: normal;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
h3 {
|
|
39
|
+
font-size: 13px;
|
|
40
|
+
line-height: 20px;
|
|
41
|
+
letter-spacing: 0.04em;
|
|
42
|
+
color: var(--color-text-primary);
|
|
43
|
+
margin-bottom: 2px;
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.preview p {
|
|
48
|
+
margin-bottom: 24px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.thumbnail {
|
|
52
|
+
height: 92px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.video {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-flow: row wrap;
|
|
58
|
+
gap: 20px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
x-link { /* stylelint-disable-line selector-type-no-unknown */
|
|
62
|
+
color: var(--color-primary);
|
|
63
|
+
text-decoration-line: underline;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
x-link.quick-start-link { /* stylelint-disable-line selector-type-no-unknown */
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
line-height: 22px;
|
|
69
|
+
letter-spacing: 0.04em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.video-description {
|
|
73
|
+
min-width: min-content;
|
|
74
|
+
flex-basis: min-content;
|
|
75
|
+
flex-grow: 1;
|
|
76
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
|
|
5
|
+
export * as FeedbackButton from './FeedbackButton.js';
|
|
6
|
+
export * as PanelFeedback from './PanelFeedback.js';
|
|
@@ -458,7 +458,7 @@ export class Widget {
|
|
|
458
458
|
this.doResize();
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
registerRequiredCSS(cssFile: string): void {
|
|
461
|
+
registerRequiredCSS(cssFile: string|{cssContent: string}): void {
|
|
462
462
|
if (this.isWebComponent) {
|
|
463
463
|
Utils.appendStyle((this.shadowRoot as DocumentFragment), cssFile);
|
|
464
464
|
} else {
|
|
@@ -7,6 +7,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
7
7
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
8
8
|
import * as UI from '../../legacy.js';
|
|
9
9
|
|
|
10
|
+
import chartViewPortStyles from './chartViewport.css.legacy.js';
|
|
10
11
|
import {MinimalTimeWindowMs} from './FlameChart.js';
|
|
11
12
|
|
|
12
13
|
export interface ChartViewportDelegate {
|
|
@@ -51,7 +52,7 @@ export class ChartViewport extends UI.Widget.VBox {
|
|
|
51
52
|
|
|
52
53
|
constructor(delegate: ChartViewportDelegate) {
|
|
53
54
|
super();
|
|
54
|
-
this.registerRequiredCSS(
|
|
55
|
+
this.registerRequiredCSS(chartViewPortStyles);
|
|
55
56
|
|
|
56
57
|
this.delegate = delegate;
|
|
57
58
|
|
|
@@ -9,6 +9,8 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
9
9
|
import type * as SDK from '../../../../core/sdk/sdk.js';
|
|
10
10
|
import * as UI from '../../legacy.js';
|
|
11
11
|
|
|
12
|
+
import filmStripViewStyles from './filmStripView.css.legacy.js';
|
|
13
|
+
|
|
12
14
|
const UIStrings = {
|
|
13
15
|
/**
|
|
14
16
|
*@description Element title in Film Strip View of the Performance panel
|
|
@@ -43,7 +45,7 @@ export class FilmStripView extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
43
45
|
|
|
44
46
|
constructor() {
|
|
45
47
|
super(true);
|
|
46
|
-
this.registerRequiredCSS(
|
|
48
|
+
this.registerRequiredCSS(filmStripViewStyles);
|
|
47
49
|
this.contentElement.classList.add('film-strip-view');
|
|
48
50
|
this.statusLabel = this.contentElement.createChild('div', 'label');
|
|
49
51
|
this.reset();
|
|
@@ -42,6 +42,7 @@ import type {ChartViewportDelegate} from './ChartViewport.js';
|
|
|
42
42
|
import {ChartViewport} from './ChartViewport.js';
|
|
43
43
|
import type {Calculator} from './TimelineGrid.js';
|
|
44
44
|
import {TimelineGrid} from './TimelineGrid.js';
|
|
45
|
+
import flameChartStyles from './flameChart.css.legacy.js';
|
|
45
46
|
|
|
46
47
|
const UIStrings = {
|
|
47
48
|
/**
|
|
@@ -157,7 +158,7 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
157
158
|
dataProvider: FlameChartDataProvider, flameChartDelegate: FlameChartDelegate,
|
|
158
159
|
groupExpansionSetting?: Common.Settings.Setting<GroupExpansionState>) {
|
|
159
160
|
super(true);
|
|
160
|
-
this.registerRequiredCSS(
|
|
161
|
+
this.registerRequiredCSS(flameChartStyles);
|
|
161
162
|
this.contentElement.classList.add('flame-chart-main-pane');
|
|
162
163
|
this.groupExpansionSetting = groupExpansionSetting;
|
|
163
164
|
this.groupExpansionState = groupExpansionSetting && groupExpansionSetting.get() || {};
|
|
@@ -35,6 +35,7 @@ import * as UI from '../../legacy.js';
|
|
|
35
35
|
|
|
36
36
|
import type {Calculator} from './TimelineGrid.js';
|
|
37
37
|
import {TimelineGrid} from './TimelineGrid.js';
|
|
38
|
+
import overviewGridStyles from './overviewGrid.css.legacy.js';
|
|
38
39
|
|
|
39
40
|
const UIStrings = {
|
|
40
41
|
/**
|
|
@@ -161,7 +162,7 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
161
162
|
|
|
162
163
|
this.parentElement.addEventListener('wheel', this.onMouseWheel.bind(this), true);
|
|
163
164
|
this.parentElement.addEventListener('dblclick', this.resizeWindowMaximum.bind(this), true);
|
|
164
|
-
UI.Utils.appendStyle(this.parentElement,
|
|
165
|
+
UI.Utils.appendStyle(this.parentElement, overviewGridStyles);
|
|
165
166
|
|
|
166
167
|
this.leftResizeElement = parentElement.createChild('div', 'overview-grid-window-resizer') as HTMLElement;
|
|
167
168
|
UI.UIUtils.installDragHandle(
|
|
@@ -36,6 +36,8 @@ import * as Host from '../../../../core/host/host.js';
|
|
|
36
36
|
import * as UI from '../../legacy.js';
|
|
37
37
|
import * as ThemeSupport from '../../theme_support/theme_support.js';
|
|
38
38
|
|
|
39
|
+
import timelineGridStyles from './timelineGrid.css.legacy.js';
|
|
40
|
+
|
|
39
41
|
const labelMap = new Map<HTMLDivElement|HTMLElement, HTMLDivElement>();
|
|
40
42
|
|
|
41
43
|
export class TimelineGrid {
|
|
@@ -47,7 +49,7 @@ export class TimelineGrid {
|
|
|
47
49
|
|
|
48
50
|
constructor() {
|
|
49
51
|
this.element = document.createElement('div');
|
|
50
|
-
UI.Utils.appendStyle(this.element,
|
|
52
|
+
UI.Utils.appendStyle(this.element, timelineGridStyles);
|
|
51
53
|
|
|
52
54
|
this.dividersElementInternal = this.element.createChild('div', 'resources-dividers');
|
|
53
55
|
|
|
@@ -36,6 +36,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
36
36
|
import type {WindowChangedWithPositionEvent} from './OverviewGrid.js';
|
|
37
37
|
import {Events as OverviewGridEvents, OverviewGrid} from './OverviewGrid.js';
|
|
38
38
|
import type {Calculator} from './TimelineGrid.js';
|
|
39
|
+
import timelineOverviewInfoStyles from './timelineOverviewInfo.css.js';
|
|
39
40
|
|
|
40
41
|
export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
|
|
41
42
|
UI.Widget.VBox) {
|
|
@@ -426,7 +427,7 @@ export class OverviewInfo {
|
|
|
426
427
|
this.visible = false;
|
|
427
428
|
this.element = UI.Utils
|
|
428
429
|
.createShadowRootWithCoreStyles(this.glassPane.contentElement, {
|
|
429
|
-
cssFile:
|
|
430
|
+
cssFile: [timelineOverviewInfoStyles],
|
|
430
431
|
delegatesFocus: undefined,
|
|
431
432
|
})
|
|
432
433
|
.createChild('div', 'overview-info');
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Root from '../../../core/root/root.js';
|
|
6
6
|
|
|
7
|
-
export function appendStyle(node: Node,
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
7
|
+
export function appendStyle(node: Node, cssReference: string|{cssContent: string}): void {
|
|
8
|
+
let content: string;
|
|
9
|
+
if (typeof cssReference === 'string') {
|
|
10
|
+
content = Root.Runtime.cachedResources.get(cssReference) || '';
|
|
11
|
+
if (!content) {
|
|
12
|
+
console.error(cssReference + ' not preloaded. Check module.json');
|
|
13
|
+
}
|
|
14
|
+
} else {
|
|
15
|
+
content = cssReference.cssContent;
|
|
11
16
|
}
|
|
12
17
|
const styleElement = document.createElement('style');
|
|
13
18
|
styleElement.textContent = content;
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"check-external-links": "third_party/node/node.py --output scripts/check_external_links.js",
|
|
32
32
|
"check-gn": "third_party/node/node.py --output scripts/check_gn.js",
|
|
33
33
|
"check-json": "third_party/node/node.py --output scripts/json_validator/validate_module_json.js",
|
|
34
|
-
"check-lint": "third_party/node/node.py --output scripts/test/run_lint_check_js.
|
|
34
|
+
"check-lint": "third_party/node/node.py --output scripts/test/run_lint_check_js.mjs && third_party/node/node.py --output scripts/test/run_lint_check_css.js",
|
|
35
35
|
"check-lint-css": "third_party/node/node.py --output scripts/test/run_lint_check_css.js",
|
|
36
36
|
"collect-strings": "third_party/node/node.py --output third_party/i18n/collect-strings.js front_end",
|
|
37
37
|
"components-server": "third_party/node/node.py --output scripts/component_server/server.js",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"unittest": "scripts/test/run_unittests.py --no-text-coverage",
|
|
56
56
|
"watch": "third_party/node/node.py --output scripts/watch_build.js"
|
|
57
57
|
},
|
|
58
|
-
"version": "1.0.
|
|
58
|
+
"version": "1.0.941208"
|
|
59
59
|
}
|
|
@@ -4,34 +4,48 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const CleanCSS = require('clean-css');
|
|
7
|
-
const [, , isDebugString, targetName, srcDir, targetGenDir, files] = process.argv;
|
|
7
|
+
const [, , isDebugString, legacyString, targetName, srcDir, targetGenDir, files] = process.argv;
|
|
8
8
|
|
|
9
9
|
const filenames = files.split(',');
|
|
10
10
|
const configFiles = [];
|
|
11
11
|
const cleanCSS = new CleanCSS();
|
|
12
12
|
const isDebug = isDebugString === 'true';
|
|
13
|
+
const isLegacy = legacyString === 'true';
|
|
13
14
|
|
|
14
15
|
for (const fileName of filenames) {
|
|
15
16
|
let output = fs.readFileSync(path.join(srcDir, fileName), {encoding: 'utf8', flag: 'r'});
|
|
16
17
|
output = output.replace(/\`/g, '\\\'');
|
|
17
18
|
output = output.replace(/\\/g, '\\\\');
|
|
18
19
|
|
|
20
|
+
const stylesheetContents = isDebug ? output : cleanCSS.minify(output).styles;
|
|
21
|
+
|
|
22
|
+
let exportStatement;
|
|
23
|
+
if (isLegacy) {
|
|
24
|
+
exportStatement = `export default {
|
|
25
|
+
cssContent: \`${stylesheetContents}\`
|
|
26
|
+
};`;
|
|
27
|
+
} else {
|
|
28
|
+
exportStatement = `const styles = new CSSStyleSheet();
|
|
29
|
+
styles.replaceSync(
|
|
30
|
+
\`${stylesheetContents}
|
|
31
|
+
/*# sourceURL=${fileName} */
|
|
32
|
+
\`);
|
|
33
|
+
export default styles;`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const generatedFileName = `${fileName}${isLegacy ? '.legacy' : ''}.js`;
|
|
37
|
+
|
|
19
38
|
fs.writeFileSync(
|
|
20
|
-
path.join(targetGenDir,
|
|
39
|
+
path.join(targetGenDir, generatedFileName),
|
|
21
40
|
`// Copyright ${new Date().getFullYear()} The Chromium Authors. All rights reserved.
|
|
22
41
|
// Use of this source code is governed by a BSD-style license that can be
|
|
23
42
|
// found in the LICENSE file.
|
|
24
43
|
// IMPORTANT: this file is auto generated. Please do not edit this file.
|
|
25
44
|
/* istanbul ignore file */
|
|
26
|
-
|
|
27
|
-
styles.replaceSync(
|
|
28
|
-
\`${isDebug ? output : cleanCSS.minify(output).styles}
|
|
29
|
-
/*# sourceURL=${fileName} */
|
|
30
|
-
\`);
|
|
31
|
-
export default styles;
|
|
45
|
+
${exportStatement}
|
|
32
46
|
`);
|
|
33
47
|
|
|
34
|
-
configFiles.push(`\"${
|
|
48
|
+
configFiles.push(`\"${generatedFileName}\"`);
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
fs.writeFileSync(path.join(targetGenDir, `${targetName}-tsconfig.json`), `{
|
|
@@ -18,6 +18,7 @@ template("generate_css") {
|
|
|
18
18
|
|
|
19
19
|
args = [
|
|
20
20
|
"$is_debug",
|
|
21
|
+
"${invoker.legacy}",
|
|
21
22
|
target_name,
|
|
22
23
|
_src,
|
|
23
24
|
_dest,
|
|
@@ -26,7 +27,11 @@ template("generate_css") {
|
|
|
26
27
|
|
|
27
28
|
outputs = []
|
|
28
29
|
foreach(_input, sources) {
|
|
29
|
-
|
|
30
|
+
_file_name = _input
|
|
31
|
+
if (invoker.legacy) {
|
|
32
|
+
_file_name = "$_file_name.legacy"
|
|
33
|
+
}
|
|
34
|
+
outputs += [ "$target_gen_dir/$_file_name.js" ]
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
data = outputs
|
|
@@ -38,3 +43,7 @@ template("generate_css") {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
46
|
+
|
|
47
|
+
set_defaults("generate_css") {
|
|
48
|
+
legacy = false
|
|
49
|
+
}
|
|
@@ -31,10 +31,10 @@ module.exports = {
|
|
|
31
31
|
ImportDeclaration(node) {
|
|
32
32
|
const importPath = path.normalize(node.source.value);
|
|
33
33
|
|
|
34
|
-
if (importPath.endsWith('.css.js')) {
|
|
34
|
+
if (importPath.endsWith('.css.js') || importPath.endsWith('.css.legacy.js')) {
|
|
35
35
|
const importingFileName = path.resolve(context.getFilename());
|
|
36
36
|
const exportingFileName = path.resolve(path.dirname(importingFileName), importPath);
|
|
37
|
-
const importedCSS = exportingFileName.replace(
|
|
37
|
+
const importedCSS = exportingFileName.replace(/(\.legacy)?\.js$/, '');
|
|
38
38
|
|
|
39
39
|
if (!fs.existsSync(importedCSS)) {
|
|
40
40
|
context.report({
|
|
@@ -14,6 +14,10 @@ ruleTester.run('check_css_import', rule, {
|
|
|
14
14
|
code: 'import styles from \'./check_css_import_test_file.css.js\';',
|
|
15
15
|
filename: 'scripts/eslint_rules/tests/file.ts',
|
|
16
16
|
},
|
|
17
|
+
{
|
|
18
|
+
code: 'import styles from \'./check_css_import_test_file.css.legacy.js\';',
|
|
19
|
+
filename: 'scripts/eslint_rules/tests/file.ts',
|
|
20
|
+
},
|
|
17
21
|
{
|
|
18
22
|
code: 'import styles from \'../../../scripts/eslint_rules/tests/check_css_import_test_file.css.js\';',
|
|
19
23
|
filename: 'front_end/ui/components/file.ts',
|
|
@@ -29,6 +33,14 @@ ruleTester.run('check_css_import', rule, {
|
|
|
29
33
|
message: 'File styles.css does not exist. Check you are importing the correct file.',
|
|
30
34
|
}],
|
|
31
35
|
},
|
|
36
|
+
{
|
|
37
|
+
// Files that do not exist are caught
|
|
38
|
+
code: 'import styles from \'styles.css.legacy.js\';',
|
|
39
|
+
filename: 'front_end/ui/components/component/file.ts',
|
|
40
|
+
errors: [{
|
|
41
|
+
message: 'File styles.css does not exist. Check you are importing the correct file.',
|
|
42
|
+
}],
|
|
43
|
+
},
|
|
32
44
|
{
|
|
33
45
|
// Filename typos are caught
|
|
34
46
|
code: 'import styles from \'../../../scripts/eslint_rules/test/check_css_import_tests_file.css.js\';',
|