chrome-devtools-frontend 1.0.947377 → 1.0.948295

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.
Files changed (97) hide show
  1. package/config/gni/all_devtools_files.gni +1 -6
  2. package/config/gni/devtools_grd_files.gni +5 -6
  3. package/config/gni/devtools_image_files.gni +1 -0
  4. package/front_end/.eslintrc.js +1 -0
  5. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  6. package/front_end/core/host/UserMetrics.ts +1 -1
  7. package/front_end/core/i18n/locales/en-US.json +17 -14
  8. package/front_end/core/i18n/locales/en-XL.json +17 -14
  9. package/front_end/core/platform/platform.ts +0 -2
  10. package/front_end/core/platform/string-utilities.ts +14 -1
  11. package/front_end/core/platform/utilities.ts +0 -29
  12. package/front_end/core/root/Runtime.ts +4 -207
  13. package/front_end/core/sdk/Cookie.ts +0 -21
  14. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  15. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  16. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  17. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  18. package/front_end/entrypoints/main/MainImpl.ts +0 -1
  19. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
  20. package/front_end/entrypoints/node_app/node_app.ts +1 -3
  21. package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
  22. package/front_end/entrypoints/worker_app/worker_app.ts +1 -3
  23. package/front_end/legacy/legacy-defs.d.ts +0 -4
  24. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  25. package/front_end/models/issues_manager/CorsIssue.ts +15 -15
  26. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  27. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  28. package/front_end/panels/application/BackForwardCacheStrings.ts +1 -5
  29. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  30. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  31. package/front_end/panels/application/application-legacy.ts +0 -3
  32. package/front_end/panels/application/application-meta.ts +0 -13
  33. package/front_end/panels/application/backForwardCacheView.css +44 -6
  34. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  35. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  36. package/front_end/panels/application/components/StackTrace.ts +1 -1
  37. package/front_end/panels/coverage/CoverageView.ts +1 -1
  38. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  39. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  40. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  41. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  42. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  43. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  44. package/front_end/panels/issues/CorsIssueDetailsView.ts +20 -8
  45. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  46. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  47. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  48. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  49. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
  50. package/front_end/panels/timeline/TimelineTreeView.ts +2 -1
  51. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  52. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  53. package/front_end/ui/components/helpers/helpers.ts +0 -2
  54. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  55. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  56. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  57. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  58. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  59. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  60. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  61. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  62. package/front_end/ui/components/report_view/reportSection.css +20 -0
  63. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  64. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  65. package/front_end/ui/components/text_editor/config.ts +4 -3
  66. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  67. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  68. package/front_end/ui/legacy/GlassPane.ts +1 -1
  69. package/front_end/ui/legacy/SearchableView.ts +2 -1
  70. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  71. package/front_end/ui/legacy/Widget.ts +1 -1
  72. package/front_end/ui/legacy/XWidget.ts +0 -5
  73. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  74. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  75. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  76. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  77. package/package.json +2 -4
  78. package/scripts/build/build_inspector_overlay.py +15 -1
  79. package/scripts/build/rjsmin.py +84 -115
  80. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  81. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  82. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  83. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  84. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  85. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
  86. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -4
  87. package/front_end/entrypoints/js_app/js_app.js +0 -12
  88. package/front_end/entrypoints/js_app/js_app.json +0 -3
  89. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
  90. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  91. package/front_end/entrypoints/startup/startup.ts +0 -9
  92. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  93. package/scripts/build/build_release_applications.py +0 -216
  94. package/scripts/build/modular_build.py +0 -184
  95. package/scripts/check_gn.js +0 -119
  96. package/scripts/json_validator/module.schema.json +0 -19
  97. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -3,7 +3,7 @@
3
3
  A site requested a resource from a network that it could only access because of its users' privileged network position.
4
4
  These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage.
5
5
 
6
- To mitigate these risks, a future version of Chrome will require non-public subresources to opt-into being accessed with a preflight request.
6
+ To mitigate these risks, Chrome will require non-public subresources to opt-into being accessed with a preflight request and will start blocking them in Chrome 101 (April 2022).
7
7
 
8
8
  To fix this issue, ensure that response to the [preflight request](issueCorsPreflightRequest) for the private network resource has the `Access-Control-Allow-Private-Network` header set to `true`.
9
9
 
@@ -107,7 +107,9 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
107
107
  if (!accessibilityModel) {
108
108
  return;
109
109
  }
110
- accessibilityModel.clear();
110
+ if (!Root.Runtime.experiments.isEnabled('fullAccessibilityTree')) {
111
+ accessibilityModel.clear();
112
+ }
111
113
  await accessibilityModel.requestPartialAXTree(node);
112
114
  this.accessibilityNodeCallback(accessibilityModel.axNodeForDOMNode(node));
113
115
  }
@@ -154,10 +154,6 @@ const UIStrings = {
154
154
  * @description Description text for not restored reason BackForwardCacheDisabledForDelegate.
155
155
  */
156
156
  backForwardCacheDisabledForDelegate: 'Back/forward cache is not supported by delegate.',
157
- /**
158
- * @description Description text for not restored reason OptInUnloadHeaderNotPresent.
159
- */
160
- optInUnloadHeaderNotPresent: 'The page has unload handler without the back/forward cache opt-in header.',
161
157
  /**
162
158
  * @description Description text for not restored reason UnloadHandlerExistsInMainFrame.
163
159
  */
@@ -466,7 +462,7 @@ export const NotRestoredReasonDescription = {
466
462
  'UserAgentOverrideDiffers': {name: i18nLazyString(UIStrings.userAgentOverrideDiffers)},
467
463
  'ForegroundCacheLimit': {name: i18nLazyString(UIStrings.foregroundCacheLimit)},
468
464
  'BackForwardCacheDisabledForDelegate': {name: i18nLazyString(UIStrings.backForwardCacheDisabledForDelegate)},
469
- 'OptInUnloadHeaderNotPresent': {name: i18nLazyString(UIStrings.optInUnloadHeaderNotPresent)},
465
+ 'OptInUnloadHeaderNotPresent': {name: i18nLazyString(UIStrings.unloadHandlerExistsInMainFrame)},
470
466
  'UnloadHandlerExistsInMainFrame': {name: i18nLazyString(UIStrings.unloadHandlerExistsInMainFrame)},
471
467
  'UnloadHandlerExistsInSubFrame': {name: i18nLazyString(UIStrings.unloadHandlerExistsInSubFrame)},
472
468
  'ServiceWorkerUnregistration': {name: i18nLazyString(UIStrings.serviceWorkerUnregistration)},
@@ -31,25 +31,22 @@ const UIStrings = {
31
31
  /**
32
32
  * @description Entry name text in the back/forward cache view of the Application panel
33
33
  */
34
- url: 'URL',
35
- /**
36
- * @description Entry name text in the back/forward cache view of the Application panel
37
- */
38
- bfcacheStatus: 'Back/forward cache Status',
34
+ url: 'URL:',
39
35
  /**
40
36
  * @description Status text for the status of the back/forward cache status
41
37
  */
42
- unknown: 'unknown',
38
+ unknown: 'Unknown Status',
43
39
  /**
44
40
  * @description Status text for the status of the back/forward cache status indicating that
45
41
  * the back/forward cache was not used and a normal navigation occured instead.
46
42
  */
47
- normalNavigation: 'Normal navigation (Not restored from back/forward cache)',
43
+ normalNavigation:
44
+ 'Not served from back/forward cache: to trigger back/forward cache, use Chrome\'s back/forward buttons, or use the test button below to automatically navigate away and back.',
48
45
  /**
49
46
  * @description Status text for the status of the back/forward cache status indicating that
50
47
  * the back/forward cache was used to restore the page instead of reloading it.
51
48
  */
52
- restoredFromBFCache: 'Restored from back/forward cache',
49
+ restoredFromBFCache: 'Successfully served from back/forward cache.',
53
50
  /**
54
51
  * @description Label for a list of reasons which prevent the page from being eligible for
55
52
  * back/forward cache. These reasons are actionable i.e. they can be cleaned up to make the
@@ -81,9 +78,17 @@ const UIStrings = {
81
78
  */
82
79
  supportPending: 'Pending Support',
83
80
  /**
84
- * @description Button name for showing whether BFCache is available in the pages.
81
+ * @description Label for the button to test whether BFCache is available for the page
82
+ */
83
+ runTest: 'Test back/forward cache',
84
+ /**
85
+ * @description Label for the disabled button while the test is running
85
86
  */
86
- runTest: 'Run Test',
87
+ runningTest: 'Running test',
88
+ /**
89
+ * @description Link Text about explanation of back/forward cache
90
+ */
91
+ learnMore: 'Learn more: back/forward cache eligibility',
87
92
  /**
88
93
  * @description Explanation for 'pending support' items which prevent the page from being eligible
89
94
  * for back/forward cache.
@@ -94,6 +99,11 @@ const UIStrings = {
94
99
  const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheView.ts', UIStrings);
95
100
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
96
101
 
102
+ const enum ScreenStatusType {
103
+ Running = 'Running',
104
+ Result = 'Result',
105
+ }
106
+
97
107
  export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
98
108
  constructor() {
99
109
  super(true, 1000);
@@ -102,8 +112,11 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
102
112
  this.getMainResourceTreeModel()?.addEventListener(
103
113
  SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated, this.onBackForwardCacheUpdate, this);
104
114
  this.update();
115
+ this.screenStatus = ScreenStatusType.Result;
105
116
  }
106
117
 
118
+ private screenStatus: ScreenStatusType;
119
+
107
120
  wasShown(): void {
108
121
  super.wasShown();
109
122
  this.registerCSSFiles([backForwardCacheViewStyles]);
@@ -117,7 +130,7 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
117
130
  const data = {reportTitle: i18nString(UIStrings.backForwardCacheTitle)};
118
131
  const html = LitHtml.html`
119
132
  <${ReportView.ReportView.Report.litTagName} .data=${data as ReportView.ReportView.ReportData}>
120
- ${this.renderMainFrameInformation(this.getMainFrame())}
133
+ ${this.renderMainFrameInformation(this.getMainFrame())}
121
134
  </${ReportView.ReportView.Report.litTagName}>
122
135
  `;
123
136
  LitHtml.render(html, this.contentElement, {host: this});
@@ -132,10 +145,20 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
132
145
  return this.getMainResourceTreeModel()?.mainFrame || null;
133
146
  }
134
147
 
148
+ private renderBackForwardCacheTestResult(): void {
149
+ SDK.TargetManager.TargetManager.instance().removeModelListener(
150
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
151
+ this.renderBackForwardCacheTestResult, this);
152
+ this.screenStatus = ScreenStatusType.Result;
153
+ this.update();
154
+ }
155
+
135
156
  private async goBackOneHistoryEntry(): Promise<void> {
136
157
  SDK.TargetManager.TargetManager.instance().removeModelListener(
137
158
  SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
138
159
  this.goBackOneHistoryEntry, this);
160
+ this.screenStatus = ScreenStatusType.Running;
161
+ this.update();
139
162
  const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
140
163
  if (!mainTarget) {
141
164
  return;
@@ -148,6 +171,9 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
148
171
  if (!historyResults) {
149
172
  return;
150
173
  }
174
+ SDK.TargetManager.TargetManager.instance().addModelListener(
175
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
176
+ this.renderBackForwardCacheTestResult, this);
151
177
  resourceTreeModel.navigateToHistoryEntry(historyResults.entries[historyResults.currentIndex - 1]);
152
178
  }
153
179
 
@@ -176,41 +202,97 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
176
202
 
177
203
  private renderMainFrameInformation(mainFrame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitHtml.TemplateResult {
178
204
  if (!mainFrame) {
179
- return LitHtml.html`<${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.mainFrame)}</${
180
- ReportView.ReportView.ReportKey.litTagName}>
181
- <${ReportView.ReportView.ReportValue.litTagName}>
182
- ${i18nString(UIStrings.unavailable)}
183
- </${ReportView.ReportView.ReportValue.litTagName}>`;
205
+ // clang-format off
206
+ return LitHtml.html`
207
+ <${ReportView.ReportView.ReportKey.litTagName}>
208
+ ${i18nString(UIStrings.mainFrame)}
209
+ </${ReportView.ReportView.ReportKey.litTagName}>
210
+ <${ReportView.ReportView.ReportValue.litTagName}>
211
+ ${i18nString(UIStrings.unavailable)}
212
+ </${ReportView.ReportView.ReportValue.litTagName}>
213
+ `;
214
+ // clang-format on
184
215
  }
216
+ const isDisabled = this.screenStatus === ScreenStatusType.Running;
217
+ // clang-format off
185
218
  return LitHtml.html`
186
- <${ReportView.ReportView.ReportSectionHeader.litTagName}>
187
- <${Buttons.Button.Button.litTagName}
188
- .variant=${Buttons.Button.Variant.PRIMARY}
189
- @click=${this.navigateAwayAndBack}>
219
+ ${this.renderBackForwardCacheStatus(mainFrame.backForwardCacheDetails.restoredFromCache)}
220
+ <div class='url'>
221
+ <div class='url-key'>
222
+ ${i18nString(UIStrings.url)}
223
+ </div>
224
+ <div class='url-value'>
225
+ ${mainFrame.url}
226
+ </div>
227
+ </div>
228
+ <${ReportView.ReportView.ReportSection.litTagName}>
229
+ <${Buttons.Button.Button.litTagName}
230
+ .disabled=${isDisabled}
231
+ .spinner=${isDisabled}
232
+ .variant=${Buttons.Button.Variant.PRIMARY}
233
+ @click=${this.navigateAwayAndBack}>
234
+ ${isDisabled ? LitHtml.html`
235
+ ${i18nString(UIStrings.runningTest)}`:`
190
236
  ${i18nString(UIStrings.runTest)}
191
- </${Buttons.Button.Button.litTagName}>
192
- </${ReportView.ReportView.ReportSectionHeader.litTagName}>
193
- <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.url)}</${
194
- ReportView.ReportView.ReportKey.litTagName}>
195
- <${ReportView.ReportView.ReportValue.litTagName}>${mainFrame.url}</${
196
- ReportView.ReportView.ReportValue.litTagName}>
197
- <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.bfcacheStatus)}</${
198
- ReportView.ReportView.ReportKey.litTagName}>
199
- <${ReportView.ReportView.ReportValue.litTagName}>${
200
- this.renderBackForwardCacheStatus(
201
- mainFrame.backForwardCacheDetails.restoredFromCache)}</${ReportView.ReportView.ReportValue.litTagName}>
202
- ${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
237
+ `}
238
+ </${Buttons.Button.Button.litTagName}>
239
+ </${ReportView.ReportView.ReportSection.litTagName}>
240
+ <${ReportView.ReportView.ReportSectionDivider.litTagName}>
241
+ </${ReportView.ReportView.ReportSectionDivider.litTagName}>
242
+ ${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
243
+ <${ReportView.ReportView.ReportSection.litTagName}>
244
+ <x-link href="https://web.dev/bfcache/" class="link">
245
+ ${i18nString(UIStrings.learnMore)}
246
+ </x-link>
247
+ </${ReportView.ReportView.ReportSection.litTagName}>
203
248
  `;
249
+ // clang-format on
204
250
  }
205
251
 
206
- private renderBackForwardCacheStatus(status: boolean|undefined): Platform.UIString.LocalizedString {
252
+ private renderBackForwardCacheStatus(status: boolean|undefined): LitHtml.TemplateResult {
207
253
  switch (status) {
208
254
  case true:
209
- return i18nString(UIStrings.restoredFromBFCache);
255
+ // clang-format off
256
+ return LitHtml.html`
257
+ <${ReportView.ReportView.ReportSection.litTagName}>
258
+ <div class='status'>
259
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
260
+ iconName: 'ic_checkmark_16x16',
261
+ color: 'green',
262
+ width: '16px',
263
+ height: '16px',
264
+ } as IconButton.Icon.IconData}>
265
+ </${IconButton.Icon.Icon.litTagName}>
266
+ </div>
267
+ ${i18nString(UIStrings.restoredFromBFCache)}
268
+ </${ReportView.ReportView.ReportSection.litTagName}>
269
+ `;
270
+ // clang-format on
210
271
  case false:
211
- return i18nString(UIStrings.normalNavigation);
272
+ // clang-format off
273
+ return LitHtml.html`
274
+ <${ReportView.ReportView.ReportSection.litTagName}>
275
+ <div class='status'>
276
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
277
+ iconName: 'circled_backslash_icon',
278
+ color: 'var(--color-text-secondary)',
279
+ width: '16px',
280
+ height: '16px',
281
+ } as IconButton.Icon.IconData}>
282
+ </${IconButton.Icon.Icon.litTagName}>
283
+ </div>
284
+ ${i18nString(UIStrings.normalNavigation)}
285
+ </${ReportView.ReportView.ReportSection.litTagName}>
286
+ `;
287
+ // clang-format on
212
288
  }
213
- return i18nString(UIStrings.unknown);
289
+ // clang-format off
290
+ return LitHtml.html`
291
+ <${ReportView.ReportView.ReportSection.litTagName}>
292
+ ${i18nString(UIStrings.unknown)}
293
+ </${ReportView.ReportView.ReportSection.litTagName}>
294
+ `;
295
+ // clang-format on
214
296
  }
215
297
 
216
298
  private maybeRenderExplanations(explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]):
@@ -243,36 +325,46 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
243
325
  // clang-format off
244
326
  return LitHtml.html`
245
327
  ${explanations.length > 0 ? LitHtml.html`
246
- <${ReportView.ReportView.ReportKey.litTagName}>
328
+ <${ReportView.ReportView.ReportSectionHeader.litTagName}>
247
329
  ${category}
248
- <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
249
- iconName: 'help_outline',
250
- color: 'var(--color-text-secondary)',
251
- width: '16px',
252
- height: '16px',
253
- } as IconButton.Icon.IconData} title=${explainerText}></${IconButton.Icon.Icon.litTagName}>
254
- </${ReportView.ReportView.ReportKey.litTagName}>
255
- <${ReportView.ReportView.ReportValue.litTagName}>
256
- <ul class='not-restored-reason-list'>${explanations.map(explanation => this.renderReason(explanation))}</ul>
257
- </${ReportView.ReportView.ReportValue.litTagName}>
330
+ <div class='help-outline-icon'>
331
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
332
+ iconName: 'help_outline',
333
+ color: 'var(--color-text-secondary)',
334
+ width: '16px',
335
+ height: '16px',
336
+ } as IconButton.Icon.IconData} title=${explainerText}>
337
+ </${IconButton.Icon.Icon.litTagName}>
338
+ </div>
339
+ </${ReportView.ReportView.ReportSectionHeader.litTagName}>
340
+ ${explanations.map(explanation => this.renderReason(explanation))}
258
341
  ` : LitHtml.nothing}
259
342
  `;
260
343
  // clang-format on
261
344
  }
262
345
 
263
346
  private renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
347
+ // clang-format off
264
348
  return LitHtml.html`
265
- <li>
266
- <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
267
- iconName: 'circled_exclamation_icon',
268
- color: 'orange',
269
- width: '16px',
270
- height: '16px',
271
- } as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}>
272
- ${explanation.reason} : ${
273
- (explanation.reason in NotRestoredReasonDescription) ?
274
- LitHtml.html`${NotRestoredReasonDescription[explanation.reason].name()}` :
275
- LitHtml.nothing} </li>
349
+ <${ReportView.ReportView.ReportSection.litTagName}>
350
+ ${(explanation.reason in NotRestoredReasonDescription) ?
351
+ LitHtml.html`
352
+ <div class='circled-exclamation-icon'>
353
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
354
+ iconName: 'circled_exclamation_icon',
355
+ color: 'orange',
356
+ width: '16px',
357
+ height: '16px',
358
+ } as IconButton.Icon.IconData}>
359
+ </${IconButton.Icon.Icon.litTagName}>
360
+ </div>
361
+ ${NotRestoredReasonDescription[explanation.reason].name()}` :
362
+ LitHtml.nothing}
363
+ </${ReportView.ReportView.ReportSection.litTagName}>
364
+ <div class='gray-text'>
365
+ ${explanation.reason}
366
+ </div>
276
367
  `;
368
+ // clang-format on
277
369
  }
278
370
  }
@@ -9,7 +9,6 @@ import * as UI from '../../ui/legacy/legacy.js';
9
9
 
10
10
  import resourcesPanelStyles from './resourcesPanel.css.js';
11
11
 
12
- import type {CookieTreeElement} from './ApplicationPanelSidebar.js';
13
12
  import {ApplicationPanelSidebar, StorageCategoryView} from './ApplicationPanelSidebar.js';
14
13
  import {CookieItemsView} from './CookieItemsView.js';
15
14
  import {DatabaseQueryView} from './DatabaseQueryView.js';
@@ -215,47 +214,6 @@ export class ResourceRevealer implements Common.Revealer.Revealer {
215
214
  }
216
215
  }
217
216
 
218
- let cookieReferenceRevealerInstance: CookieReferenceRevealer;
219
-
220
- export class CookieReferenceRevealer implements Common.Revealer.Revealer {
221
- static instance(opts: {
222
- forceNew: boolean|null,
223
- } = {forceNew: null}): CookieReferenceRevealer {
224
- const {forceNew} = opts;
225
- if (!cookieReferenceRevealerInstance || forceNew) {
226
- cookieReferenceRevealerInstance = new CookieReferenceRevealer();
227
- }
228
-
229
- return cookieReferenceRevealerInstance;
230
- }
231
- async reveal(cookie: Object): Promise<void> {
232
- if (!(cookie instanceof SDK.Cookie.CookieReference)) {
233
- throw new Error('Internal error: not a cookie reference');
234
- }
235
-
236
- const sidebar = await ResourcesPanel.showAndGetSidebar();
237
- await sidebar.cookieListTreeElement.select();
238
-
239
- const contextUrl = cookie.contextUrl();
240
- if (contextUrl && await this.revealByDomain(sidebar, contextUrl)) {
241
- return;
242
- }
243
- // Fallback: try to reveal the cookie using its domain as context, which may not work, because the
244
- // Application Panel shows cookies grouped by context, see crbug.com/1060563.
245
- this.revealByDomain(sidebar, cookie.domain());
246
- }
247
-
248
- private async revealByDomain(sidebar: ApplicationPanelSidebar, domain: string): Promise<boolean> {
249
- const item = sidebar.cookieListTreeElement.children().find(
250
- c => /** @type {!CookieTreeElement} */ (c as CookieTreeElement).cookieDomain().endsWith(domain));
251
- if (item) {
252
- await item.revealAndSelect();
253
- return true;
254
- }
255
- return false;
256
- }
257
- }
258
-
259
217
  let frameDetailsRevealerInstance: FrameDetailsRevealer;
260
218
 
261
219
  export class FrameDetailsRevealer implements Common.Revealer.Revealer {
@@ -95,9 +95,6 @@ Resources.ResourcesPanel = ResourcesModule.ResourcesPanel.ResourcesPanel;
95
95
  /** @constructor */
96
96
  Resources.ResourcesPanel.ResourceRevealer = ResourcesModule.ResourcesPanel.ResourceRevealer;
97
97
 
98
- /** @constructor */
99
- Resources.ResourcesPanel.CookieReferenceRevealer = ResourcesModule.ResourcesPanel.CookieReferenceRevealer;
100
-
101
98
  /** @constructor */
102
99
  Resources.ResourcesPanel.FrameDetailsRevealer = ResourcesModule.ResourcesPanel.FrameDetailsRevealer;
103
100
 
@@ -139,19 +139,6 @@ Common.Revealer.registerRevealer({
139
139
  },
140
140
  });
141
141
 
142
- Common.Revealer.registerRevealer({
143
- contextTypes() {
144
- return [
145
- SDK.Cookie.CookieReference,
146
- ];
147
- },
148
- destination: Common.Revealer.RevealerDestination.APPLICATION_PANEL,
149
- async loadRevealer() {
150
- const Resources = await loadResourcesModule();
151
- return Resources.ResourcesPanel.CookieReferenceRevealer.instance();
152
- },
153
- });
154
-
155
142
  Common.Revealer.registerRevealer({
156
143
  contextTypes() {
157
144
  return [
@@ -3,12 +3,50 @@
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
- .not-restored-reason-list {
7
- margin: 0;
8
- list-style-type: none;
9
- padding-inline-start: 0;
10
- }
11
-
12
6
  .inline-icon {
13
7
  vertical-align: sub;
14
8
  }
9
+
10
+ .gray-text {
11
+ color: var(--color-text-secondary);
12
+ margin: 0 0 15px 56px;
13
+ display: flex;
14
+ flex-direction: row;
15
+ align-items: center;
16
+ flex: auto;
17
+ overflow-wrap: break-word;
18
+ overflow: hidden;
19
+ }
20
+
21
+ .help-outline-icon {
22
+ margin: 0 2px;
23
+ }
24
+
25
+ .circled-exclamation-icon {
26
+ margin-right: 10px;
27
+ flex-shrink: 0;
28
+ }
29
+
30
+ .status {
31
+ margin-right: 15px;
32
+ flex-shrink: 0;
33
+ }
34
+
35
+ .url {
36
+ grid-column-start: span 2;
37
+ display: flex;
38
+ align-items: center;
39
+ margin: 0 30px;
40
+ line-height: 28px;
41
+ }
42
+
43
+ .url-key {
44
+ color: var(--color-text-secondary);
45
+ min-width: auto;
46
+ overflow-wrap: break-word;
47
+ }
48
+
49
+ .url-value {
50
+ padding: 0 6px;
51
+ overflow-wrap: break-word;
52
+ }
@@ -318,7 +318,7 @@ export class FrameDetailsReportView extends HTMLElement {
318
318
  return LitHtml.html`
319
319
  <${ReportView.ReportView.ReportSectionHeader.litTagName}>
320
320
  ${i18n.i18n.lockedString('Origin Trials')}
321
- <${IconButton.IconButton.IconButton.litTagName} class="inline-button" .data="${{
321
+ <${IconButton.IconButton.IconButton.litTagName} class="inline-button" .data=${{
322
322
  clickHandler: refreshOriginTrials,
323
323
  groups: [
324
324
  {
@@ -326,7 +326,7 @@ export class FrameDetailsReportView extends HTMLElement {
326
326
  text: 'Refresh',
327
327
  } as IconButton.IconButton.IconWithTextData,
328
328
  ],
329
- } as IconButton.IconButton.IconButtonData}">
329
+ } as IconButton.IconButton.IconButtonData}>
330
330
  </${IconButton.IconButton.IconButton.litTagName}>
331
331
  </${ReportView.ReportView.ReportSectionHeader.litTagName}>
332
332
  ${this.originTrialTreeView}
@@ -541,7 +541,7 @@ export class FrameDetailsReportView extends HTMLElement {
541
541
  return LitHtml.nothing;
542
542
  }
543
543
  const typeStrings = this.getAdFrameTypeStrings(adFrameType);
544
- const rows = [LitHtml.html`<div title="${typeStrings.description}">${typeStrings.value}</div>`];
544
+ const rows = [LitHtml.html`<div title=${typeStrings.description}>${typeStrings.value}</div>`];
545
545
  for (const explanation of this.frame.adFrameStatus()?.explanations || []) {
546
546
  rows.push(LitHtml.html`<div>${this.getAdFrameExplanationString(explanation)}</div>`);
547
547
  }
@@ -229,7 +229,7 @@ export class OriginTrialTokenRows extends HTMLElement {
229
229
  }
230
230
 
231
231
  private renderTokenField = (fieldValue: string, hasError?: boolean): LitHtml.TemplateResult => LitHtml.html`
232
- <div class="${LitHtml.Directives.ifDefined(hasError ? 'error-text' : undefined)}">
232
+ <div class=${LitHtml.Directives.ifDefined(hasError ? 'error-text' : undefined)}>
233
233
  ${fieldValue}
234
234
  </div>`;
235
235
 
@@ -334,10 +334,10 @@ export class OriginTrialTreeView extends HTMLElement {
334
334
 
335
335
  LitHtml.render(
336
336
  LitHtml.html`
337
- <${TreeOutline.TreeOutline.TreeOutline.litTagName} .data="${{
337
+ <${TreeOutline.TreeOutline.TreeOutline.litTagName} .data=${{
338
338
  tree: trials.map(constructOriginTrialTree),
339
339
  defaultRenderer,
340
- } as TreeOutline.TreeOutline.TreeOutlineData<OriginTrialTreeNodeData>}">
340
+ } as TreeOutline.TreeOutline.TreeOutlineData<OriginTrialTreeNodeData>}>
341
341
  </${TreeOutline.TreeOutline.TreeOutline.litTagName}>
342
342
  `,
343
343
  this.shadow, {host: this});
@@ -64,7 +64,7 @@ export class StackTraceRow extends HTMLElement {
64
64
  LitHtml.render(
65
65
  LitHtml.html`
66
66
  <div class="stack-trace-row">
67
- <div class="stack-trace-function-name text-ellipsis" title="${this.stackTraceRowItem.functionName}">
67
+ <div class="stack-trace-function-name text-ellipsis" title=${this.stackTraceRowItem.functionName}>
68
68
  ${this.stackTraceRowItem.functionName}
69
69
  </div>
70
70
  <div class="stack-trace-source-location">
@@ -470,7 +470,7 @@ export class CoverageView extends UI.Widget.VBox {
470
470
  return;
471
471
  }
472
472
  const text = this.filterInput.value();
473
- this.textFilterRegExp = text ? createPlainTextSearchRegex(text, 'i') : null;
473
+ this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
474
474
  this.listView.updateFilterAndHighlight(this.textFilterRegExp);
475
475
  this.updateStats();
476
476
  }
@@ -14,6 +14,7 @@ h1 {
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  background-color: var(--color-background);
17
+ overflow: auto;
17
18
  }
18
19
 
19
20
  .summary-header {
@@ -249,7 +249,7 @@
249
249
 
250
250
  .overview-completed-view .font-info .font-metric {
251
251
  display: grid;
252
- grid-template-columns: 1fr 1fr 1fr;
252
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
253
253
  grid-gap: 12px;
254
254
  }
255
255
 
@@ -4,6 +4,7 @@
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 Platform from '../../core/platform/platform.js';
7
8
  import * as SDK from '../../core/sdk/sdk.js';
8
9
  import * as UI from '../../ui/legacy/legacy.js';
9
10
 
@@ -125,7 +126,7 @@ export class DeveloperResourcesView extends UI.Widget.VBox {
125
126
  }
126
127
 
127
128
  const text = this.filterInput.value();
128
- this.textFilterRegExp = text ? createPlainTextSearchRegex(text, 'i') : null;
129
+ this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
129
130
  this.listView.updateFilterAndHighlight(this.textFilterRegExp);
130
131
  this.updateStats();
131
132
  }
@@ -291,8 +291,16 @@ export class ElementsPanel extends UI.Panel.Panel implements UI.SearchableView.S
291
291
  }
292
292
 
293
293
  private showDOMTree(): void {
294
- // TODO(meredithl): Scroll to inspected DOM node.
295
294
  this.splitWidget.setMainWidget(this.searchableViewInternal);
295
+ const selectedNode = this.selectedDOMNode();
296
+ if (!selectedNode) {
297
+ return;
298
+ }
299
+ const treeElement = this.treeElementForNode(selectedNode);
300
+ if (!treeElement) {
301
+ return;
302
+ }
303
+ treeElement.select();
296
304
  }
297
305
 
298
306
  static instance(opts: {
@@ -1899,7 +1899,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
1899
1899
  this.hideSearchHighlight();
1900
1900
 
1901
1901
  const text = this.listItemElement.textContent || '';
1902
- const regexObject = createPlainTextSearchRegex(this.searchQuery, 'gi');
1902
+ const regexObject = Platform.StringUtilities.createPlainTextSearchRegex(this.searchQuery, 'gi');
1903
1903
 
1904
1904
  let match = regexObject.exec(text);
1905
1905
  const matchRanges = [];
@@ -276,7 +276,7 @@ export class ElementsBreadcrumbs extends HTMLElement {
276
276
  // Disabled until https://crbug.com/1079231 is fixed.
277
277
  // clang-format off
278
278
  LitHtml.render(LitHtml.html`
279
- <nav class="crumbs" aria-label="${i18nString(UIStrings.breadcrumbs)}">
279
+ <nav class="crumbs" aria-label=${i18nString(UIStrings.breadcrumbs)}>
280
280
  ${this.renderOverflowButton('left', this.userScrollPosition === 'start')}
281
281
 
282
282
  <div class="crumbs-window" @scroll=${this.onCrumbsWindowScroll}>