chrome-devtools-frontend 1.0.1537860 → 1.0.1538523
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/.env.template +3 -2
- package/eslint.config.mjs +151 -149
- package/front_end/core/host/AidaClient.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/root/Runtime.ts +8 -0
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +151 -0
- package/front_end/models/ai_code_generation/ai_code_generation.ts +6 -0
- package/front_end/models/ai_code_generation/debug.ts +30 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +10 -2
- package/front_end/panels/application/components/OriginTrialTreeView.ts +97 -129
- package/front_end/panels/application/components/originTrialTreeView.css +37 -7
- package/front_end/panels/application/preloading/components/PreloadingString.ts +13 -11
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +1 -0
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +5 -6
- package/front_end/panels/network/RequestTimingView.ts +404 -348
- package/front_end/panels/network/networkTimingTable.css +22 -2
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +42 -3
- package/front_end/panels/timeline/components/networkRequestTooltip.css +19 -0
- package/front_end/ui/components/adorners/Adorner.ts +1 -0
- package/front_end/ui/components/icon_button/IconButton.ts +1 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -0
- package/front_end/ui/legacy/Treeoutline.ts +15 -0
- package/front_end/ui/legacy/UIUtils.ts +3 -0
- package/front_end/ui/legacy/Widget.ts +6 -4
- package/front_end/ui/legacy/XLink.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +1 -0
- package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +1 -0
- package/front_end/ui/legacy/popover.css +12 -11
- package/package.json +1 -1
- package/front_end/panels/application/components/badge.css +0 -33
|
@@ -78,8 +78,8 @@ table.network-timing-table > tr:not(.network-timing-table-header, .network-timin
|
|
|
78
78
|
.network-timing-bar {
|
|
79
79
|
position: absolute;
|
|
80
80
|
min-width: 1px;
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
inset: 0 attr(data-right %) 0 attr(data-left %); /* stylelint-disable-line declaration-property-value-no-unknown */
|
|
82
|
+
background-color: attr(data-background <color>); /* stylelint-disable-line declaration-property-value-no-unknown */
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.network-timing-bar-title {
|
|
@@ -145,6 +145,16 @@ table.network-timing-table > tr:not(.network-timing-table-header, .network-timin
|
|
|
145
145
|
left: -12px;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
tr:has([aria-checked="false"].network-fetch-timing-bar-clickable) ~ .router-evaluation-timing-bar-details,
|
|
149
|
+
tr:has([aria-checked="false"].network-fetch-timing-bar-clickable) ~ .network-fetch-timing-bar-details {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
tr:has([aria-checked].network-fetch-timing-bar-clickable) ~ .router-evaluation-timing-bar-details,
|
|
154
|
+
tr:has([aria-checked].network-fetch-timing-bar-clickable) ~ .network-fetch-timing-bar-details {
|
|
155
|
+
display: block;
|
|
156
|
+
}
|
|
157
|
+
|
|
148
158
|
.network-fetch-timing-bar-clickable:focus-visible {
|
|
149
159
|
background-color: var(--sys-color-state-focus-highlight);
|
|
150
160
|
}
|
|
@@ -181,6 +191,16 @@ table.network-timing-table > tr:not(.network-timing-table-header, .network-timin
|
|
|
181
191
|
background-color: var(--network-overview-waiting); /* stylelint-disable-line plugin/use_theme_colors */
|
|
182
192
|
}
|
|
183
193
|
|
|
194
|
+
.throttled devtools-icon {
|
|
195
|
+
vertical-align: middle;
|
|
196
|
+
margin-right: var(--sys-size-3);
|
|
197
|
+
color: var(--sys-color-yellow);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
td.throttled {
|
|
201
|
+
color: var(--sys-color-yellow);
|
|
202
|
+
}
|
|
203
|
+
|
|
184
204
|
.network-timing-bar.receiving,
|
|
185
205
|
.network-timing-bar.receiving-push,
|
|
186
206
|
.-theme-preserve {
|
|
@@ -7,6 +7,7 @@ import '../../../ui/components/icon_button/icon_button.js';
|
|
|
7
7
|
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import * as Platform from '../../../core/platform/platform.js';
|
|
10
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
11
|
import * as Trace from '../../../models/trace/trace.js';
|
|
11
12
|
import * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js';
|
|
12
13
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
@@ -15,7 +16,7 @@ import * as TimelineUtils from '../utils/utils.js';
|
|
|
15
16
|
import networkRequestTooltipStyles from './networkRequestTooltip.css.js';
|
|
16
17
|
import {colorForNetworkRequest, networkResourceCategory} from './Utils.js';
|
|
17
18
|
|
|
18
|
-
const {html} = Lit;
|
|
19
|
+
const {html, nothing, Directives: {classMap, ifDefined}} = Lit;
|
|
19
20
|
|
|
20
21
|
const MAX_URL_LENGTH = 60;
|
|
21
22
|
|
|
@@ -52,6 +53,11 @@ const UIStrings = {
|
|
|
52
53
|
* @description Text to refer to the list of redirects.
|
|
53
54
|
*/
|
|
54
55
|
redirects: 'Redirects',
|
|
56
|
+
/**
|
|
57
|
+
* @description Cell title in Network Data Grid Node of the Network panel
|
|
58
|
+
* @example {Fast 4G} PH1
|
|
59
|
+
*/
|
|
60
|
+
wasThrottled: 'Request was throttled ({PH1})',
|
|
55
61
|
} as const;
|
|
56
62
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/NetworkRequestTooltip.ts', UIStrings);
|
|
57
63
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -106,6 +112,16 @@ export class NetworkRequestTooltip extends HTMLElement {
|
|
|
106
112
|
backgroundColor: color,
|
|
107
113
|
};
|
|
108
114
|
|
|
115
|
+
const sdkNetworkRequest = SDK.TraceObject.RevealableNetworkRequest.create(networkRequest);
|
|
116
|
+
const wasThrottled = sdkNetworkRequest &&
|
|
117
|
+
SDK.NetworkManager.MultitargetNetworkManager.instance().appliedRequestConditions(
|
|
118
|
+
sdkNetworkRequest.networkRequest);
|
|
119
|
+
const throttledTitle = wasThrottled ? i18nString(UIStrings.wasThrottled, {
|
|
120
|
+
PH1: typeof wasThrottled.conditions.title === 'string' ? wasThrottled.conditions.title :
|
|
121
|
+
wasThrottled.conditions.title()
|
|
122
|
+
}) :
|
|
123
|
+
undefined;
|
|
124
|
+
|
|
109
125
|
// The outside spans are transparent with a border on the outside edge.
|
|
110
126
|
// The inside spans are 1px tall rectangles, vertically centered, with background color.
|
|
111
127
|
// |
|
|
@@ -114,9 +130,20 @@ export class NetworkRequestTooltip extends HTMLElement {
|
|
|
114
130
|
const leftWhisker = html`<span class="whisker-left"> <span class="horizontal"></span> </span>`;
|
|
115
131
|
const rightWhisker = html`<span class="whisker-right"> <span class="horizontal"></span> </span>`;
|
|
116
132
|
|
|
133
|
+
const classes = classMap({
|
|
134
|
+
['timings-row timings-row--duration']: true,
|
|
135
|
+
throttled: Boolean(wasThrottled?.urlPattern),
|
|
136
|
+
});
|
|
117
137
|
return html`
|
|
118
|
-
<div
|
|
119
|
-
|
|
138
|
+
<div
|
|
139
|
+
class=${classes}
|
|
140
|
+
title=${ifDefined(throttledTitle)}>
|
|
141
|
+
${
|
|
142
|
+
wasThrottled?.urlPattern ? html`<devtools-icon
|
|
143
|
+
class=indicator
|
|
144
|
+
name=watch
|
|
145
|
+
></devtools-icon>` :
|
|
146
|
+
html`<span class="indicator"></span>`}
|
|
120
147
|
${i18nString(UIStrings.duration)}
|
|
121
148
|
<span class="time"> ${i18n.TimeUtilities.formatMicroSecondsTime(networkRequest.dur)} </span>
|
|
122
149
|
</div>
|
|
@@ -173,6 +200,11 @@ export class NetworkRequestTooltip extends HTMLElement {
|
|
|
173
200
|
|
|
174
201
|
const redirectsHtml = NetworkRequestTooltip.renderRedirects(this.#data.networkRequest);
|
|
175
202
|
|
|
203
|
+
const sdkNetworkRequest = SDK.TraceObject.RevealableNetworkRequest.create(this.#data.networkRequest);
|
|
204
|
+
const wasThrottled = sdkNetworkRequest &&
|
|
205
|
+
SDK.NetworkManager.MultitargetNetworkManager.instance().appliedRequestConditions(
|
|
206
|
+
sdkNetworkRequest.networkRequest);
|
|
207
|
+
|
|
176
208
|
// clang-format off
|
|
177
209
|
const output = html`
|
|
178
210
|
<style>${networkRequestTooltipStyles}</style>
|
|
@@ -186,6 +218,13 @@ export class NetworkRequestTooltip extends HTMLElement {
|
|
|
186
218
|
</span>${networkResourceCategory(this.#data.networkRequest)}
|
|
187
219
|
</div>
|
|
188
220
|
<div class="priority-row">${i18nString(UIStrings.priority)}: ${NetworkRequestTooltip.renderPriorityValue(this.#data.networkRequest)}</div>
|
|
221
|
+
${wasThrottled ? html`
|
|
222
|
+
<div class="throttled-row">
|
|
223
|
+
${i18nString(UIStrings.wasThrottled, {
|
|
224
|
+
PH1: typeof wasThrottled.conditions.title === 'string' ? wasThrottled.conditions.title :
|
|
225
|
+
wasThrottled.conditions.title()
|
|
226
|
+
})}
|
|
227
|
+
</div>` : nothing}
|
|
189
228
|
${Trace.Helpers.Network.isSyntheticNetworkRequestEventRenderBlocking(this.#data.networkRequest) ?
|
|
190
229
|
html`<div class="render-blocking"> ${i18nString(UIStrings.renderBlocking)} </div>` : Lit.nothing
|
|
191
230
|
}
|
|
@@ -22,6 +22,11 @@
|
|
|
22
22
|
margin-left: 15px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
.throttled-row {
|
|
26
|
+
margin-left: 15px;
|
|
27
|
+
color: var(--sys-color-yellow);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
.network-category-chip {
|
|
26
31
|
box-sizing: border-box;
|
|
27
32
|
width: 10px;
|
|
@@ -62,6 +67,16 @@
|
|
|
62
67
|
box-sizing: border-box;
|
|
63
68
|
}
|
|
64
69
|
|
|
70
|
+
devtools-icon.indicator {
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
height: 12px;
|
|
73
|
+
width: 12px;
|
|
74
|
+
margin-right: 4px;
|
|
75
|
+
color: var(--sys-color-yellow);
|
|
76
|
+
border: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
65
80
|
.whisker-left {
|
|
66
81
|
align-self: center;
|
|
67
82
|
display: inline-flex;
|
|
@@ -104,6 +119,10 @@
|
|
|
104
119
|
.time {
|
|
105
120
|
font-weight: var(--ref-typeface-weight-medium);
|
|
106
121
|
}
|
|
122
|
+
|
|
123
|
+
&.throttled {
|
|
124
|
+
color: var(--sys-color-yellow);
|
|
125
|
+
}
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
.redirects-row {
|
|
@@ -1604,6 +1604,18 @@ function getTreeNodes(nodeList: NodeList|Node[]): HTMLLIElement[] {
|
|
|
1604
1604
|
.toArray();
|
|
1605
1605
|
}
|
|
1606
1606
|
|
|
1607
|
+
function getStyleElements(nodes: NodeList|Node[]): HTMLElement[] {
|
|
1608
|
+
return [...nodes].flatMap(node => {
|
|
1609
|
+
if (node instanceof HTMLStyleElement) {
|
|
1610
|
+
return [node];
|
|
1611
|
+
}
|
|
1612
|
+
if (node instanceof HTMLElement) {
|
|
1613
|
+
return [...node.querySelectorAll<HTMLStyleElement>('style')];
|
|
1614
|
+
}
|
|
1615
|
+
return [] as HTMLElement[];
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1607
1619
|
/**
|
|
1608
1620
|
* A tree element that can be used as progressive enhancement over a <ul> element. A `template` IDL attribute allows
|
|
1609
1621
|
* additionally to insert the <ul> into a <template>, avoiding rendering anything into light DOM, which is recommended.
|
|
@@ -1763,6 +1775,9 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1763
1775
|
parent.treeElement.expand();
|
|
1764
1776
|
}
|
|
1765
1777
|
}
|
|
1778
|
+
for (const element of getStyleElements(nodes)) {
|
|
1779
|
+
this.#treeOutline.shadowRoot.appendChild(element.cloneNode(true));
|
|
1780
|
+
}
|
|
1766
1781
|
}
|
|
1767
1782
|
|
|
1768
1783
|
protected override removeNodes(nodes: NodeList): void {
|
|
@@ -1480,6 +1480,7 @@ export class DevToolsIconLabel extends HTMLElement {
|
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
1482
|
|
|
1483
|
+
// eslint-disable-next-line @devtools/enforce-custom-element-prefix
|
|
1483
1484
|
customElements.define('dt-icon-label', DevToolsIconLabel);
|
|
1484
1485
|
|
|
1485
1486
|
export class DevToolsSmallBubble extends HTMLElement {
|
|
@@ -1498,6 +1499,7 @@ export class DevToolsSmallBubble extends HTMLElement {
|
|
|
1498
1499
|
}
|
|
1499
1500
|
}
|
|
1500
1501
|
|
|
1502
|
+
// eslint-disable-next-line @devtools/enforce-custom-element-prefix
|
|
1501
1503
|
customElements.define('dt-small-bubble', DevToolsSmallBubble);
|
|
1502
1504
|
|
|
1503
1505
|
export class DevToolsCloseButton extends HTMLElement {
|
|
@@ -1536,6 +1538,7 @@ export class DevToolsCloseButton extends HTMLElement {
|
|
|
1536
1538
|
}
|
|
1537
1539
|
}
|
|
1538
1540
|
|
|
1541
|
+
// eslint-disable-next-line @devtools/enforce-custom-element-prefix
|
|
1539
1542
|
customElements.define('dt-close-button', DevToolsCloseButton);
|
|
1540
1543
|
|
|
1541
1544
|
export function bindInput(
|
|
@@ -35,7 +35,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
35
35
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
36
36
|
import * as Lit from '../../ui/lit/lit.js';
|
|
37
37
|
|
|
38
|
-
import {createShadowRootWithCoreStyles} from './UIUtils.js';
|
|
38
|
+
import {cloneCustomElement, createShadowRootWithCoreStyles} from './UIUtils.js';
|
|
39
39
|
|
|
40
40
|
// Remember the original DOM mutation methods here, since we
|
|
41
41
|
// will override them below to sanity check the Widget system.
|
|
@@ -227,12 +227,14 @@ export class WidgetElement<WidgetT extends Widget> extends HTMLElement {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
override cloneNode(deep: boolean): Node {
|
|
230
|
-
const clone =
|
|
230
|
+
const clone = cloneCustomElement(this, deep);
|
|
231
231
|
if (!this.#widgetClass) {
|
|
232
232
|
throw new Error('No widgetClass defined');
|
|
233
233
|
}
|
|
234
|
-
clone
|
|
235
|
-
|
|
234
|
+
clone.widgetConfig = {
|
|
235
|
+
widgetClass: this.#widgetClass,
|
|
236
|
+
widgetParams: this.#widgetParams,
|
|
237
|
+
};
|
|
236
238
|
return clone;
|
|
237
239
|
}
|
|
238
240
|
}
|
|
@@ -3,17 +3,18 @@
|
|
|
3
3
|
* Use of this source code is governed by a BSD-style license that can be
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
.widget {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
@scope to (.widget > *) {
|
|
7
|
+
.widget {
|
|
8
|
+
display: flex;
|
|
9
|
+
font: var(--sys-typescale-body4-regular);
|
|
10
|
+
box-shadow: var(--sys-elevation-level2);
|
|
11
|
+
color: var(--sys-color-on-surface);
|
|
12
|
+
background-color: var(--sys-color-base-container-elevated);
|
|
13
|
+
border-radius: var(--sys-shape-corner-small);
|
|
14
|
+
padding: var(--sys-size-4);
|
|
15
|
+
user-select: text;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
}
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
.squiggles-content {
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2021 The Chromium Authors
|
|
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
|
-
:host .badge-error {
|
|
8
|
-
--override-adorner-text-color: var(--sys-color-error-bright);
|
|
9
|
-
--override-adorner-border-color: var(--sys-color-error-bright);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host .badge-success {
|
|
13
|
-
--override-adorner-text-color: var(--sys-color-tertiary);
|
|
14
|
-
--override-adorner-border-color: var(--sys-color-tertiary);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host .badge-secondary {
|
|
18
|
-
--override-adorner-text-color: var(--sys-color-token-subtle);
|
|
19
|
-
--override-adorner-border-color: var(--sys-color-token-subtle);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Use mono-space source code font to assist reading of adorner content */
|
|
23
|
-
:host devtools-adorner {
|
|
24
|
-
font-family: var(--source-code-font-family);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.token-status-badge {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[aria-expanded='false'] .token-status-badge {
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
}
|