chrome-devtools-frontend 1.0.1553956 → 1.0.1555174

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.
@@ -0,0 +1,10 @@
1
+ <svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1320_25512)">
3
+ <path d="M7 12.6319C6.94299 12.6319 6.89549 12.6129 6.85749 12.5749C6.81948 12.5369 6.79098 12.4894 6.77198 12.4324C6.61997 11.8338 6.38245 11.259 6.05942 10.708C5.74589 10.1474 5.37536 9.64862 4.94782 9.21158C4.51078 8.77454 4.01199 8.39926 3.45144 8.08573C2.90039 7.7722 2.32559 7.53943 1.72704 7.38742C1.67003 7.36842 1.62253 7.33992 1.58452 7.30191C1.54652 7.26391 1.52752 7.2164 1.52752 7.1594C1.52752 7.10239 1.54652 7.05489 1.58452 7.01689C1.62253 6.97888 1.67003 6.95038 1.72704 6.93138C2.32559 6.77937 2.90039 6.5466 3.45144 6.23307C4.00249 5.91954 4.50128 5.54426 4.94782 5.10722C5.38486 4.67968 5.76014 4.18564 6.07367 3.62509C6.3872 3.06454 6.61997 2.48499 6.77198 1.88644C6.79098 1.82943 6.81948 1.78193 6.85749 1.74392C6.89549 1.70592 6.94299 1.68692 7 1.68692C7.057 1.68692 7.10451 1.70592 7.14251 1.74392C7.18052 1.78193 7.20902 1.82943 7.22802 1.88644C7.38003 2.48499 7.6128 3.06454 7.92633 3.62509C8.23986 4.17614 8.61514 4.67018 9.05218 5.10722C9.48922 5.54426 9.98326 5.91954 10.5343 6.23307C11.0949 6.5466 11.6744 6.77937 12.273 6.93138C12.33 6.95038 12.3775 6.97888 12.4155 7.01689C12.4535 7.05489 12.4725 7.10239 12.4725 7.1594C12.4725 7.2164 12.4535 7.26391 12.4155 7.30191C12.3775 7.33992 12.33 7.36842 12.273 7.38742C11.6744 7.53943 11.0949 7.7722 10.5343 8.08573C9.97376 8.39926 9.47972 8.77454 9.05218 9.21158C8.61514 9.65812 8.23986 10.1569 7.92633 10.708C7.6128 11.259 7.38003 11.8338 7.22802 12.4324C7.20902 12.4894 7.18052 12.5369 7.14251 12.5749C7.10451 12.6129 7.057 12.6319 7 12.6319Z" fill="#0B57D0"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_1320_25512">
7
+ <rect width="14" height="15.1442" fill="white"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -105,7 +105,6 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
105
105
  return null;
106
106
  }
107
107
 
108
- // TODO(crbug.com/445966299): Refactor to use `storageAgent().invoke_getStorageKey()` instead.
109
108
  const response = await this.storageAgent.invoke_getStorageKey({frameId});
110
109
  if (response.getError() === 'Frame tree node for given frame not found') {
111
110
  return null;
@@ -757,6 +757,7 @@ export const generatedProperties = [
757
757
  "transition-property",
758
758
  "transition-timing-function",
759
759
  "translate",
760
+ "trigger-scope",
760
761
  "types",
761
762
  "unicode-range",
762
763
  "user-select",
@@ -1712,6 +1713,7 @@ export const generatedProperties = [
1712
1713
  "inherited": false,
1713
1714
  "keywords": [
1714
1715
  "none",
1716
+ "auto",
1715
1717
  "spanning-item",
1716
1718
  "intersection"
1717
1719
  ],
@@ -3722,6 +3724,7 @@ export const generatedProperties = [
3722
3724
  "inherited": false,
3723
3725
  "keywords": [
3724
3726
  "none",
3727
+ "auto",
3725
3728
  "spanning-item",
3726
3729
  "intersection"
3727
3730
  ],
@@ -4650,6 +4653,13 @@ export const generatedProperties = [
4650
4653
  {
4651
4654
  "name": "translate"
4652
4655
  },
4656
+ {
4657
+ "keywords": [
4658
+ "none",
4659
+ "all"
4660
+ ],
4661
+ "name": "trigger-scope"
4662
+ },
4653
4663
  {
4654
4664
  "name": "types"
4655
4665
  },
@@ -5421,6 +5431,7 @@ export const generatedPropertyValues = {
5421
5431
  "column-rule-break": {
5422
5432
  "values": [
5423
5433
  "none",
5434
+ "auto",
5424
5435
  "spanning-item",
5425
5436
  "intersection"
5426
5437
  ]
@@ -6546,6 +6557,7 @@ export const generatedPropertyValues = {
6546
6557
  "row-rule-break": {
6547
6558
  "values": [
6548
6559
  "none",
6560
+ "auto",
6549
6561
  "spanning-item",
6550
6562
  "intersection"
6551
6563
  ]
@@ -7027,6 +7039,12 @@ export const generatedPropertyValues = {
7027
7039
  "step-end"
7028
7040
  ]
7029
7041
  },
7042
+ "trigger-scope": {
7043
+ "values": [
7044
+ "none",
7045
+ "all"
7046
+ ]
7047
+ },
7030
7048
  "unicode-bidi": {
7031
7049
  "values": [
7032
7050
  "normal",
@@ -3154,7 +3154,7 @@ export const NativeFunctions = [
3154
3154
  },
3155
3155
  {
3156
3156
  name: "initKeyboardEvent",
3157
- signatures: [["typeArg","?bubblesArg","?cancelableArg","?viewArg","?keyArg","?locationArg","?ctrlKey","?altKey","?shiftKey","?metaKey"],["type","?bubbles","?cancelable","?view","?keyIdentifier","?location","?ctrlKey","?altKey","?shiftKey","?metaKey"]]
3157
+ signatures: [["typeArg","?bubblesArg","?cancelableArg","?viewArg","?keyArg","?locationArg","?ctrlKey","?altKey","?shiftKey","?metaKey"]]
3158
3158
  },
3159
3159
  {
3160
3160
  name: "setKeyframes",
@@ -6611,6 +6611,10 @@ export const NativeFunctions = [
6611
6611
  name: "when",
6612
6612
  signatures: [["type","?options"]]
6613
6613
  },
6614
+ {
6615
+ name: "Event",
6616
+ signatures: [["type","?eventInitDict"]]
6617
+ },
6614
6618
  {
6615
6619
  name: "setFormControlRange",
6616
6620
  signatures: [["element","start","end"]]
@@ -6737,10 +6741,6 @@ export const NativeFunctions = [
6737
6741
  name: "TextUpdateEvent",
6738
6742
  signatures: [["type","?options"]]
6739
6743
  },
6740
- {
6741
- name: "AnimationEvent",
6742
- signatures: [["type","?eventInitDict"]]
6743
- },
6744
6744
  {
6745
6745
  name: "AnimationPlaybackEvent",
6746
6746
  signatures: [["type","?eventInitDict"]]
@@ -6769,10 +6769,6 @@ export const NativeFunctions = [
6769
6769
  name: "ErrorEvent",
6770
6770
  signatures: [["type","?eventInitDict"]]
6771
6771
  },
6772
- {
6773
- name: "FocusEvent",
6774
- signatures: [["type","?eventInitDict"]]
6775
- },
6776
6772
  {
6777
6773
  name: "HashChangeEvent",
6778
6774
  signatures: [["type","?eventInitDict"]]
@@ -6785,10 +6781,6 @@ export const NativeFunctions = [
6785
6781
  name: "InterestEvent",
6786
6782
  signatures: [["type","?eventInitDict"]]
6787
6783
  },
6788
- {
6789
- name: "KeyboardEvent",
6790
- signatures: [["type","?eventInitDict"]]
6791
- },
6792
6784
  {
6793
6785
  name: "MessageEvent",
6794
6786
  signatures: [["type","?eventInitDict"]]
@@ -6829,14 +6821,6 @@ export const NativeFunctions = [
6829
6821
  name: "ToggleEvent",
6830
6822
  signatures: [["type","?eventInitDict"]]
6831
6823
  },
6832
- {
6833
- name: "TouchEvent",
6834
- signatures: [["type","?eventInitDict"]]
6835
- },
6836
- {
6837
- name: "TransitionEvent",
6838
- signatures: [["type","?eventInitDict"]]
6839
- },
6840
6824
  {
6841
6825
  name: "UIEvent",
6842
6826
  signatures: [["type","?eventInitDict"]]
@@ -7161,6 +7145,10 @@ export const NativeFunctions = [
7161
7145
  name: "NavigationCurrentEntryChangeEvent",
7162
7146
  signatures: [["type","eventInit"]]
7163
7147
  },
7148
+ {
7149
+ name: "addHandler",
7150
+ signatures: [["handler"]]
7151
+ },
7164
7152
  {
7165
7153
  name: "updateCurrentEntry",
7166
7154
  signatures: [["options"]]
@@ -7606,11 +7594,11 @@ export const NativeFunctions = [
7606
7594
  },
7607
7595
  {
7608
7596
  name: "drawElement",
7609
- signatures: [["element","x","y","?dwidth","?dheight"]]
7597
+ signatures: [["element","dx","dy","?dwidth","?dheight"]]
7610
7598
  },
7611
7599
  {
7612
7600
  name: "drawElementImage",
7613
- signatures: [["element","x","y","?dwidth","?dheight"]]
7601
+ signatures: [["element","dx","dy","?dwidth","?dheight"],["element","sx","sy","swidth","sheight","dx","dy","?dwidth","?dheight"]]
7614
7602
  },
7615
7603
  {
7616
7604
  name: "Path2D",
@@ -8432,6 +8420,10 @@ export const NativeFunctions = [
8432
8420
  name: "RTCSessionDescription",
8433
8421
  signatures: [["?descriptionInitDict"]]
8434
8422
  },
8423
+ {
8424
+ name: "copyPayloadTo",
8425
+ signatures: [["destination"]]
8426
+ },
8435
8427
  {
8436
8428
  name: "RtcTransport",
8437
8429
  signatures: [["name"]]
@@ -5,9 +5,7 @@
5
5
  import * as Host from '../../core/host/host.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import type * as Platform from '../../core/platform/platform.js';
8
- import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
9
8
  import {createIcon} from '../../ui/kit/kit.js';
10
- import * as UI from '../../ui/legacy/legacy.js';
11
9
 
12
10
  import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
13
11
  import * as ApplicationComponents from './components/components.js';
@@ -23,8 +21,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/application/BounceTrackingMitig
23
21
  export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
24
22
 
25
23
  export class BounceTrackingMitigationsTreeElement extends ApplicationPanelTreeElement {
26
- private view?: LegacyWrapper.LegacyWrapper.LegacyWrapper<
27
- UI.Widget.Widget, ApplicationComponents.BounceTrackingMitigationsView.BounceTrackingMitigationsView>;
24
+ private view?: ApplicationComponents.BounceTrackingMitigationsView.BounceTrackingMitigationsView;
28
25
 
29
26
  constructor(resourcesPanel: ResourcesPanel) {
30
27
  super(resourcesPanel, i18nString(UIStrings.bounceTrackingMitigations), false, 'bounce-tracking-mitigations');
@@ -39,8 +36,7 @@ export class BounceTrackingMitigationsTreeElement extends ApplicationPanelTreeEl
39
36
  override onselect(selectedByUser?: boolean): boolean {
40
37
  super.onselect(selectedByUser);
41
38
  if (!this.view) {
42
- this.view = LegacyWrapper.LegacyWrapper.legacyWrapper(
43
- UI.Widget.Widget, new ApplicationComponents.BounceTrackingMitigationsView.BounceTrackingMitigationsView());
39
+ this.view = new ApplicationComponents.BounceTrackingMitigationsView.BounceTrackingMitigationsView();
44
40
  }
45
41
  this.showView(this.view);
46
42
  Host.userMetrics.panelShown('bounce-tracking-mitigations');
@@ -1,7 +1,6 @@
1
1
  // Copyright 2023 The Chromium Authors
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
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
4
 
6
5
  import '../../../ui/components/report_view/report_view.js';
7
6
  import '../../../ui/legacy/components/data_grid/data_grid.js';
@@ -9,7 +8,7 @@ import '../../../ui/legacy/components/data_grid/data_grid.js';
9
8
  import * as i18n from '../../../core/i18n/i18n.js';
10
9
  import * as SDK from '../../../core/sdk/sdk.js';
11
10
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
12
- import * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js';
11
+ import * as UI from '../../../ui/legacy/legacy.js';
13
12
  import * as Lit from '../../../ui/lit/lit.js';
14
13
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
15
14
 
@@ -58,7 +57,8 @@ const UIStrings = {
58
57
  const str_ = i18n.i18n.registerUIStrings('panels/application/components/BounceTrackingMitigationsView.ts', UIStrings);
59
58
  export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
60
59
 
61
- const enum ScreenStatusType {
60
+ export const enum ScreenStatusType {
61
+ INITIALIZING = 'Initializing',
62
62
  RUNNING = 'Running',
63
63
  RESULT = 'Result',
64
64
  DISABLED = 'Disabled',
@@ -68,119 +68,155 @@ export interface BounceTrackingMitigationsViewData {
68
68
  trackingSites: string[];
69
69
  }
70
70
 
71
- export class BounceTrackingMitigationsView extends LegacyWrapper.LegacyWrapper.WrappableComponent {
72
- readonly #shadow = this.attachShadow({mode: 'open'});
73
- #trackingSites: string[] = [];
74
- #screenStatus = ScreenStatusType.RESULT;
75
- #checkedFeature = false;
76
- #seenButtonClick = false;
77
-
78
- connectedCallback(): void {
79
- void this.#render();
80
- this.parentElement?.classList.add('overflow-auto');
81
- }
71
+ export interface ViewInput {
72
+ screenStatus: ScreenStatusType;
73
+ trackingSites: string[];
74
+ seenButtonClick: boolean;
75
+ runMitigations: () => Promise<void>;
76
+ }
82
77
 
83
- async #render(): Promise<void> {
84
- // clang-format off
85
- Lit.render(html`
86
- <style>${bounceTrackingMitigationsViewStyles}</style>
87
- <devtools-report .data=${{reportTitle: i18nString(UIStrings.bounceTrackingMitigationsTitle)}}
88
- jslog=${VisualLogging.pane('bounce-tracking-mitigations')}>
89
- ${await this.#renderMainFrameInformation()}
90
- </devtools-report>
91
- `, this.#shadow, {host: this});
92
- // clang-format on
78
+ const renderForceRunButton = (input: ViewInput): Lit.TemplateResult => {
79
+ const isMitigationRunning = (input.screenStatus === ScreenStatusType.RUNNING);
80
+
81
+ // clang-format off
82
+ return html`
83
+ <devtools-button
84
+ aria-label=${i18nString(UIStrings.forceRun)}
85
+ .disabled=${isMitigationRunning}
86
+ .spinner=${isMitigationRunning}
87
+ .variant=${Buttons.Button.Variant.PRIMARY}
88
+ @click=${input.runMitigations}
89
+ jslog=${VisualLogging.action('force-run').track({click: true})}>
90
+ ${isMitigationRunning ? html`
91
+ ${i18nString(UIStrings.runningMitigations)}`:`
92
+ ${i18nString(UIStrings.forceRun)}
93
+ `}
94
+ </devtools-button>
95
+ `;
96
+ // clang-format on
97
+ };
98
+
99
+ const renderDeletedSitesOrNoSitesMessage = (input: ViewInput): Lit.LitTemplate => {
100
+ if (!input.seenButtonClick) {
101
+ return Lit.nothing;
93
102
  }
94
103
 
95
- async #renderMainFrameInformation(): Promise<Lit.TemplateResult> {
96
- if (!this.#checkedFeature) {
97
- await this.#checkFeatureState();
98
- }
99
-
100
- if (this.#screenStatus === ScreenStatusType.DISABLED) {
101
- // clang-format off
102
- return html`
103
- <devtools-report-section>
104
- ${i18nString(UIStrings.featureDisabled)}
105
- </devtools-report-section>
106
- `;
107
- // clang-format on
108
- }
109
-
104
+ if (input.trackingSites.length === 0) {
110
105
  // clang-format off
111
106
  return html`
112
107
  <devtools-report-section>
113
- ${this.#renderForceRunButton()}
114
- </devtools-report-section>
115
- ${this.#renderDeletedSitesOrNoSitesMessage()}
116
- <devtools-report-divider>
117
- </devtools-report-divider>
118
- <devtools-report-section>
119
- <x-link href="https://privacycg.github.io/nav-tracking-mitigations/#bounce-tracking-mitigations" class="link"
120
- jslog=${VisualLogging.link('learn-more').track({click: true})}>
121
- ${i18nString(UIStrings.learnMore)}
122
- </x-link>
108
+ ${(input.screenStatus === ScreenStatusType.RUNNING) ? html`
109
+ ${i18nString(UIStrings.checkingPotentialTrackers)}`:`
110
+ ${i18nString(UIStrings.noPotentialBounceTrackersIdentified)}
111
+ `}
123
112
  </devtools-report-section>
124
113
  `;
125
114
  // clang-format on
126
115
  }
127
116
 
128
- #renderForceRunButton(): Lit.TemplateResult {
129
- const isMitigationRunning = (this.#screenStatus === ScreenStatusType.RUNNING);
117
+ // clang-format off
118
+ return html`
119
+ <devtools-report-section>
120
+ <devtools-data-grid striped inline>
121
+ <table>
122
+ <tr>
123
+ <th id="sites" weight="10" sortable>
124
+ ${i18nString(UIStrings.stateDeletedFor)}
125
+ </th>
126
+ </tr>
127
+ ${input.trackingSites.map(site => html`
128
+ <tr><td>${site}</td></tr>`)}
129
+ </table>
130
+ </devtools-data-grid>
131
+ </devtools-report-section>
132
+ `;
133
+ // clang-format on
134
+ };
135
+
136
+ const renderMainFrameInformation = (input: ViewInput): Lit.LitTemplate => {
137
+ if (input.screenStatus === ScreenStatusType.INITIALIZING) {
138
+ return Lit.nothing;
139
+ }
130
140
 
141
+ if (input.screenStatus === ScreenStatusType.DISABLED) {
131
142
  // clang-format off
132
143
  return html`
133
- <devtools-button
134
- aria-label=${i18nString(UIStrings.forceRun)}
135
- .disabled=${isMitigationRunning}
136
- .spinner=${isMitigationRunning}
137
- .variant=${Buttons.Button.Variant.PRIMARY}
138
- @click=${this.#runMitigations}
139
- jslog=${VisualLogging.action('force-run').track({click: true})}>
140
- ${isMitigationRunning ? html`
141
- ${i18nString(UIStrings.runningMitigations)}`:`
142
- ${i18nString(UIStrings.forceRun)}
143
- `}
144
- </devtools-button>
144
+ <devtools-report-section>
145
+ ${i18nString(UIStrings.featureDisabled)}
146
+ </devtools-report-section>
145
147
  `;
146
148
  // clang-format on
147
149
  }
148
150
 
149
- #renderDeletedSitesOrNoSitesMessage(): Lit.LitTemplate {
150
- if (!this.#seenButtonClick) {
151
- return Lit.nothing;
152
- }
151
+ // clang-format off
152
+ return html`
153
+ <devtools-report-section>
154
+ ${renderForceRunButton(input)}
155
+ </devtools-report-section>
156
+ ${renderDeletedSitesOrNoSitesMessage(input)}
157
+ <devtools-report-divider>
158
+ </devtools-report-divider>
159
+ <devtools-report-section>
160
+ <x-link href="https://privacycg.github.io/nav-tracking-mitigations/#bounce-tracking-mitigations" class="link"
161
+ jslog=${VisualLogging.link('learn-more').track({click: true})}>
162
+ ${i18nString(UIStrings.learnMore)}
163
+ </x-link>
164
+ </devtools-report-section>
165
+ `;
166
+ // clang-format on
167
+ };
168
+
169
+ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
170
+ // clang-format off
171
+ Lit.render(html`
172
+ <style>${bounceTrackingMitigationsViewStyles}</style>
173
+ <style>${UI.inspectorCommonStyles}</style>
174
+ <devtools-report .data=${{reportTitle: i18nString(UIStrings.bounceTrackingMitigationsTitle)}}
175
+ jslog=${VisualLogging.pane('bounce-tracking-mitigations')}>
176
+ ${renderMainFrameInformation(input)}
177
+ </devtools-report>
178
+ `, target);
179
+ // clang-format on
180
+ };
181
+
182
+ type ViewFunction = typeof DEFAULT_VIEW;
183
+
184
+ export class BounceTrackingMitigationsView extends UI.Widget.Widget {
185
+ #trackingSites: string[] = [];
186
+ #screenStatus = ScreenStatusType.INITIALIZING;
187
+ #seenButtonClick = false;
188
+ #view: ViewFunction;
189
+
190
+ constructor(element?: HTMLElement, view: ViewFunction = DEFAULT_VIEW) {
191
+ super(element, {useShadowDom: true, classes: ['overflow-auto']});
153
192
 
154
- if (this.#trackingSites.length === 0) {
155
- // clang-format off
156
- return html`
157
- <devtools-report-section>
158
- ${(this.#screenStatus === ScreenStatusType.RUNNING) ? html`
159
- ${i18nString(UIStrings.checkingPotentialTrackers)}`:`
160
- ${i18nString(UIStrings.noPotentialBounceTrackersIdentified)}
161
- `}
162
- </devtools-report-section>
163
- `;
164
- // clang-format on
193
+ this.#view = view;
194
+
195
+ const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
196
+ if (!mainTarget) {
197
+ this.#screenStatus = ScreenStatusType.RESULT;
198
+ } else {
199
+ void mainTarget.systemInfo().invoke_getFeatureState({featureState: 'DIPS'}).then(state => {
200
+ this.#screenStatus = state.featureEnabled ? ScreenStatusType.RESULT : ScreenStatusType.DISABLED;
201
+ this.requestUpdate();
202
+ });
165
203
  }
204
+ }
166
205
 
167
- // clang-format off
168
- return html`
169
- <devtools-report-section>
170
- <devtools-data-grid striped inline>
171
- <table>
172
- <tr>
173
- <th id="sites" weight="10" sortable>
174
- ${i18nString(UIStrings.stateDeletedFor)}
175
- </th>
176
- </tr>
177
- ${this.#trackingSites.map(site => html`
178
- <tr><td>${site}</td></tr>`)}
179
- </table>
180
- </devtools-data-grid>
181
- </devtools-report-section>
182
- `;
183
- // clang-format on
206
+ override wasShown(): void {
207
+ super.wasShown();
208
+ this.requestUpdate();
209
+ }
210
+
211
+ override performUpdate(): void {
212
+ this.#view(
213
+ {
214
+ screenStatus: this.#screenStatus,
215
+ trackingSites: this.#trackingSites,
216
+ seenButtonClick: this.#seenButtonClick,
217
+ runMitigations: this.#runMitigations.bind(this),
218
+ },
219
+ undefined, this.contentElement);
184
220
  }
185
221
 
186
222
  async #runMitigations(): Promise<void> {
@@ -192,7 +228,7 @@ export class BounceTrackingMitigationsView extends LegacyWrapper.LegacyWrapper.W
192
228
  this.#seenButtonClick = true;
193
229
  this.#screenStatus = ScreenStatusType.RUNNING;
194
230
 
195
- void this.#render();
231
+ this.requestUpdate();
196
232
 
197
233
  const response = await mainTarget.storageAgent().invoke_runBounceTrackingMitigations();
198
234
  this.#trackingSites = [];
@@ -205,27 +241,6 @@ export class BounceTrackingMitigationsView extends LegacyWrapper.LegacyWrapper.W
205
241
 
206
242
  #renderMitigationsResult(): void {
207
243
  this.#screenStatus = ScreenStatusType.RESULT;
208
- void this.#render();
209
- }
210
-
211
- async #checkFeatureState(): Promise<void> {
212
- this.#checkedFeature = true;
213
-
214
- const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
215
- if (!mainTarget) {
216
- return;
217
- }
218
-
219
- if (!(await mainTarget.systemInfo().invoke_getFeatureState({featureState: 'DIPS'})).featureEnabled) {
220
- this.#screenStatus = ScreenStatusType.DISABLED;
221
- }
222
- }
223
- }
224
-
225
- customElements.define('devtools-bounce-tracking-mitigations-view', BounceTrackingMitigationsView);
226
-
227
- declare global {
228
- interface HTMLElementTagNameMap {
229
- 'devtools-bounce-tracking-mitigations-view': BounceTrackingMitigationsView;
244
+ this.requestUpdate();
230
245
  }
231
246
  }
@@ -208,11 +208,19 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
208
208
  (input.thirdPartyControlsDict ? !input.thirdPartyControlsDict?.thirdPartyCookieMetadataEnabled: false) ?
209
209
  i18nFormatStringTemplate(UIStrings.enableFlag, {
210
210
  PH1: getChromeFlagsLink('#tpcd-metadata-grants'),
211
- }) :
212
- i18nFormatString(input.isGracePeriodActive ? UIStrings.gracePeriodExplanation : UIStrings.enrollGracePeriod, {
213
- PH1: UI.Fragment.html`<x-link class="devtools-link" href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period" jslog=${VisualLogging.link('grace-period-link').track({click: true})}>${i18nString(UIStrings.gracePeriod)}</x-link>`,
214
- })
215
- }
211
+ })
212
+ : i18nFormatStringTemplate(
213
+ input.isGracePeriodActive
214
+ ? UIStrings.gracePeriodExplanation
215
+ : UIStrings.enrollGracePeriod,
216
+ {
217
+ PH1: html`<devtools-link
218
+ href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period"
219
+ .jslogContext=${'grace-period-link'}
220
+ >${i18nString(UIStrings.gracePeriod)}</devtools-link
221
+ >`,
222
+ },
223
+ )}
216
224
  </div>
217
225
  </div>
218
226
  </label>
@@ -241,11 +249,14 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
241
249
  (input.thirdPartyControlsDict ? !input.thirdPartyControlsDict.thirdPartyCookieHeuristicsEnabled: false) ?
242
250
  i18nFormatStringTemplate(UIStrings.enableFlag, {
243
251
  PH1: getChromeFlagsLink('#tpcd-heuristics-grants'),
244
- }) :
245
- i18nFormatString(UIStrings.heuristicExplanation, {
246
- PH1: UI.Fragment.html`<x-link class="devtools-link" href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/heuristics-based-exceptions" jslog=${VisualLogging.link('heuristic-link').track({click: true})}>${i18nString(UIStrings.scenarios)}</x-link>`,
247
- })
248
- }
252
+ })
253
+ : i18nFormatStringTemplate(UIStrings.heuristicExplanation, {
254
+ PH1: html`<devtools-link
255
+ href="https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/heuristics-based-exceptions"
256
+ .jslogContext=${'heuristic-link'}
257
+ >${i18nString(UIStrings.scenarios)}</devtools-link
258
+ >`,
259
+ })}
249
260
  </div>
250
261
  </div>
251
262
  </label>
@@ -510,7 +510,6 @@ export class CompatibilityTracksAppender {
510
510
  * @returns the index of the event in all events to be rendered in the flamechart.
511
511
  */
512
512
  appendEventAtLevel(event: Trace.Types.Events.Event, level: number, appender: TrackAppender): number {
513
- // TODO(crbug.com/1442454) Figure out how to avoid the circular calls.
514
513
  this.#trackForLevel.set(level, appender);
515
514
  const index = this.#entryData.length;
516
515
  this.#entryData.push(event);
@@ -4,7 +4,6 @@
4
4
  /* eslint-disable @devtools/no-imperative-dom-api */
5
5
 
6
6
  import type * as Trace from '../../../models/trace/trace.js';
7
- import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';
8
7
  import * as UI from '../../../ui/legacy/legacy.js';
9
8
 
10
9
  import {InsightActivated, InsightDeactivated} from './insights/SidebarInsight.js';
@@ -156,7 +155,7 @@ export class SidebarWidget extends UI.Widget.VBox {
156
155
  }
157
156
 
158
157
  class InsightsView extends UI.Widget.VBox {
159
- #component = new SidebarInsightsTab();
158
+ #component = SidebarInsightsTab.createWidgetElement();
160
159
 
161
160
  constructor() {
162
161
  super();
@@ -165,21 +164,31 @@ class InsightsView extends UI.Widget.VBox {
165
164
  }
166
165
 
167
166
  setParsedTrace(parsedTrace: Trace.TraceModel.ParsedTrace|null): void {
168
- this.#component.parsedTrace = parsedTrace;
167
+ this.#component.widgetConfig = UI.Widget.widgetConfig(SidebarInsightsTab, {parsedTrace});
169
168
  }
170
169
 
171
170
  getActiveInsight(): ActiveInsight|null {
172
- return this.#component.activeInsight;
171
+ const widget = this.#component.getWidget();
172
+ if (widget) {
173
+ return widget.activeInsight;
174
+ }
175
+
176
+ return null;
173
177
  }
174
178
 
175
179
  setActiveInsight(active: ActiveInsight|null, opts: {highlight: boolean}): void {
176
- this.#component.activeInsight = active;
180
+ const widget = this.#component.getWidget();
181
+ if (!widget) {
182
+ return;
183
+ }
184
+
185
+ widget.activeInsight = active;
177
186
  if (opts.highlight && active) {
178
187
  // Wait for the rendering of the component to be done, otherwise we
179
188
  // might highlight the wrong insight. The UI needs to be fully
180
189
  // re-rendered before we can highlight the newly-expanded insight.
181
- void RenderCoordinator.done().then(() => {
182
- this.#component.highlightActiveInsight();
190
+ void widget.updateComplete.then(() => {
191
+ widget.highlightActiveInsight();
183
192
  });
184
193
  }
185
194
  }