chrome-devtools-frontend 1.0.1548870 → 1.0.1549484

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 (188) hide show
  1. package/docs/contributing/settings-experiments-features.md +35 -0
  2. package/docs/styleguide/ux/patterns.md +27 -0
  3. package/eslint.config.mjs +1 -0
  4. package/front_end/Tests.js +2 -0
  5. package/front_end/core/host/InspectorFrontendHost.ts +26 -558
  6. package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
  7. package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
  8. package/front_end/core/host/ResourceLoader.ts +9 -23
  9. package/front_end/core/host/UserMetrics.ts +4 -4
  10. package/front_end/core/root/DevToolsContext.ts +4 -0
  11. package/front_end/core/root/Runtime.ts +10 -0
  12. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
  13. package/front_end/core/sdk/CSSModel.ts +24 -24
  14. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
  15. package/front_end/core/sdk/CSSQuery.ts +1 -1
  16. package/front_end/core/sdk/CSSRule.ts +2 -2
  17. package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
  18. package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
  19. package/front_end/core/sdk/DOMModel.ts +3 -0
  20. package/front_end/core/sdk/NetworkManager.ts +29 -31
  21. package/front_end/core/sdk/NetworkRequest.ts +4 -0
  22. package/front_end/core/sdk/OverlayModel.ts +2 -2
  23. package/front_end/core/sdk/PageResourceLoader.ts +63 -37
  24. package/front_end/core/sdk/SourceMap.ts +6 -0
  25. package/front_end/core/sdk/SourceMapCache.ts +21 -0
  26. package/front_end/core/sdk/SourceMapManager.ts +7 -6
  27. package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
  28. package/front_end/core/sdk/TargetManager.ts +14 -2
  29. package/front_end/core/sdk/sdk-meta.ts +13 -0
  30. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
  31. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +13 -3
  33. package/front_end/foundation/Universe.ts +1 -1
  34. package/front_end/generated/Deprecation.ts +18 -4
  35. package/front_end/generated/InspectorBackendCommands.ts +33 -31
  36. package/front_end/generated/SupportedCSSProperties.js +41 -41
  37. package/front_end/generated/protocol-mapping.d.ts +12 -0
  38. package/front_end/generated/protocol-proxy-api.d.ts +11 -0
  39. package/front_end/generated/protocol.ts +70 -35
  40. package/front_end/models/ai_assistance/AiConversation.ts +5 -4
  41. package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
  42. package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
  43. package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
  44. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
  45. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
  46. package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
  47. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
  48. package/front_end/models/bindings/ResourceMapping.ts +73 -0
  49. package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
  50. package/front_end/models/issues_manager/GenericIssue.ts +17 -0
  51. package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
  52. package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
  53. package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
  54. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
  55. package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
  56. package/front_end/models/workspace/UISourceCode.ts +51 -44
  57. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
  58. package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
  59. package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
  60. package/front_end/panels/application/AppManifestView.ts +3 -2
  61. package/front_end/panels/application/FrameDetailsView.ts +5 -6
  62. package/front_end/panels/application/ServiceWorkersView.ts +2 -2
  63. package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
  64. package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
  65. package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
  66. package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
  67. package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
  68. package/front_end/panels/application/components/TrustTokensView.ts +76 -68
  69. package/front_end/panels/console/ConsoleView.ts +3 -2
  70. package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
  71. package/front_end/panels/console/console-meta.ts +0 -13
  72. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
  73. package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
  74. package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
  75. package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
  76. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
  77. package/front_end/panels/elements/LayoutPane.ts +12 -10
  78. package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
  79. package/front_end/panels/elements/components/AdornerManager.ts +3 -3
  80. package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
  81. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
  82. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
  83. package/front_end/panels/media/PlayerListView.ts +100 -73
  84. package/front_end/panels/media/playerListView.css +5 -0
  85. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
  86. package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
  87. package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
  88. package/front_end/panels/network/resourceChunkView.css +4 -0
  89. package/front_end/panels/security/CookieControlsView.ts +1 -1
  90. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  91. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
  92. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  93. package/front_end/panels/settings/SettingsScreen.ts +6 -6
  94. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  95. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
  96. package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
  97. package/front_end/panels/sources/CSSPlugin.ts +1 -1
  98. package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
  99. package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
  100. package/front_end/panels/sources/NavigatorView.ts +2 -2
  101. package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
  102. package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
  103. package/front_end/panels/sources/ProfilePlugin.ts +21 -12
  104. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
  105. package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
  106. package/front_end/panels/timeline/TimelinePanel.ts +17 -18
  107. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
  108. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  109. package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
  110. package/front_end/panels/utils/utils.ts +17 -3
  111. package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
  112. package/front_end/panels/whats_new/resources/WNDT.md +8 -8
  113. package/front_end/third_party/chromium/README.chromium +1 -1
  114. package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
  115. package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
  116. package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
  117. package/front_end/ui/components/adorners/Adorner.ts +1 -1
  118. package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
  119. package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
  120. package/front_end/ui/components/annotations/annotations.ts +6 -0
  121. package/front_end/ui/components/buttons/Button.ts +1 -1
  122. package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
  123. package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
  124. package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
  125. package/front_end/ui/components/dialogs/Dialog.ts +1 -1
  126. package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
  127. package/front_end/ui/components/diff_view/DiffView.ts +1 -1
  128. package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
  129. package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
  130. package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
  131. package/front_end/ui/components/highlighting/highlighting.ts +7 -0
  132. package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
  133. package/front_end/ui/components/icon_button/Icon.ts +4 -2
  134. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  135. package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
  136. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
  137. package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
  138. package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
  139. package/front_end/ui/components/list/List.ts +184 -0
  140. package/front_end/ui/components/list/list.css +90 -0
  141. package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
  142. package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
  143. package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
  144. package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
  145. package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
  146. package/front_end/ui/components/menus/Menu.ts +1 -1
  147. package/front_end/ui/components/menus/SelectMenu.ts +1 -1
  148. package/front_end/ui/components/node_text/NodeText.ts +1 -1
  149. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
  150. package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
  151. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
  152. package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
  153. package/front_end/ui/components/report_view/ReportView.ts +1 -1
  154. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  155. package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
  156. package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
  157. package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
  158. package/front_end/ui/components/spinners/Spinner.ts +1 -1
  159. package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
  160. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
  161. package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
  162. package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
  163. package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
  164. package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
  165. package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
  166. package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
  167. package/front_end/ui/kit/kit.ts +5 -0
  168. package/front_end/ui/legacy/TabbedPane.ts +98 -0
  169. package/front_end/ui/legacy/UIUtils.ts +0 -184
  170. package/front_end/ui/legacy/ViewManager.ts +23 -8
  171. package/front_end/ui/legacy/ViewRegistration.ts +21 -22
  172. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
  173. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
  174. package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
  175. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
  176. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
  177. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
  178. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
  179. package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
  180. package/front_end/ui/legacy/tabbedPane.css +10 -0
  181. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  182. package/inspector_overlay/README.md +3 -3
  183. package/mcp/HostBindings.ts +310 -0
  184. package/mcp/mcp.ts +17 -0
  185. package/mcp/tsconfig.json +6 -1
  186. package/package.json +26 -24
  187. /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
  188. /package/front_end/ui/{components → kit}/cards/card.css +0 -0
@@ -26,7 +26,7 @@ export enum RegisteredAdorners {
26
26
  CONTAINER = 'container',
27
27
  FLEX = 'flex',
28
28
  GRID = 'grid',
29
- MASONRY = 'masonry',
29
+ GRID_LANES = 'grid-lanes',
30
30
  MEDIA = 'media',
31
31
  POPOVER = 'popover',
32
32
  REVEAL = 'reveal',
@@ -56,9 +56,9 @@ export function getRegisteredAdorner(which: RegisteredAdorners): RegisteredAdorn
56
56
  category: AdornerCategories.LAYOUT,
57
57
  enabledByDefault: true,
58
58
  };
59
- case RegisteredAdorners.MASONRY:
59
+ case RegisteredAdorners.GRID_LANES:
60
60
  return {
61
- name: 'masonry',
61
+ name: 'grid-lanes',
62
62
  category: AdornerCategories.LAYOUT,
63
63
  enabledByDefault: true,
64
64
  };
@@ -187,20 +187,20 @@ declare global {
187
187
  }
188
188
  }
189
189
 
190
- export class MasonryEditor extends StylePropertyEditor {
191
- readonly jslogContext = 'cssMasonryEditor';
192
- protected override readonly editableProperties: EditableProperty[] = MasonryEditableProperties;
190
+ export class GridLanesEditor extends StylePropertyEditor {
191
+ readonly jslogContext = 'cssGridLanesEditor';
192
+ protected override readonly editableProperties: EditableProperty[] = GridLanesEditableProperties;
193
193
 
194
194
  protected override findIcon(query: string, computedProperties: Map<string, string>): IconInfo|null {
195
195
  return findGridContainerIcon(query, computedProperties);
196
196
  }
197
197
  }
198
198
 
199
- customElements.define('devtools-masonry-editor', MasonryEditor);
199
+ customElements.define('devtools-grid-lanes-editor', GridLanesEditor);
200
200
 
201
201
  declare global {
202
202
  interface HTMLElementTagNameMap {
203
- 'devtools-masonry-editor': MasonryEditor;
203
+ 'devtools-grid-lanes-editor': GridLanesEditor;
204
204
  }
205
205
  }
206
206
 
@@ -301,7 +301,7 @@ export const GridEditableProperties = [
301
301
  },
302
302
  ];
303
303
 
304
- export const MasonryEditableProperties = [
304
+ export const GridLanesEditableProperties = [
305
305
  {
306
306
  propertyName: 'align-content',
307
307
  propertyValues: [
@@ -6,7 +6,7 @@
6
6
  import '../../../ui/components/icon_button/icon_button.js';
7
7
 
8
8
  import * as i18n from '../../../core/i18n/i18n.js';
9
- import * as Lit from '../../../ui/lit/lit.js';
9
+ import {Directives, html, render, type TemplateResult} from '../../../ui/lit/lit.js';
10
10
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
11
11
 
12
12
  import linearMemoryHighlightChipListStyles from './linearMemoryHighlightChipList.css.js';
@@ -28,76 +28,54 @@ const UIStrings = {
28
28
  const str_ = i18n.i18n.registerUIStrings(
29
29
  'panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts', UIStrings);
30
30
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
31
- const {render, html} = Lit;
31
+ const {classMap} = Directives;
32
32
 
33
33
  export interface LinearMemoryHighlightChipListData {
34
34
  highlightInfos: HighlightInfo[];
35
35
  focusedMemoryHighlight?: HighlightInfo;
36
- }
37
-
38
- export class DeleteMemoryHighlightEvent extends Event {
39
- static readonly eventName = 'deletememoryhighlight';
40
- data: HighlightInfo;
41
-
42
- constructor(highlightInfo: HighlightInfo) {
43
- super(DeleteMemoryHighlightEvent.eventName, {bubbles: true, composed: true});
44
- this.data = highlightInfo;
45
- }
46
- }
47
-
48
- export class JumpToHighlightedMemoryEvent extends Event {
49
- static readonly eventName = 'jumptohighlightedmemory';
50
- data: number;
51
-
52
- constructor(address: number) {
53
- super(JumpToHighlightedMemoryEvent.eventName);
54
- this.data = address;
55
- }
36
+ jumpToAddress?: (address: number) => void;
37
+ deleteHighlight?: (highlightInfo: HighlightInfo) => void;
56
38
  }
57
39
 
58
40
  export class LinearMemoryHighlightChipList extends HTMLElement {
59
41
  readonly #shadow = this.attachShadow({mode: 'open'});
60
42
  #highlightedAreas: HighlightInfo[] = [];
61
43
  #focusedMemoryHighlight?: HighlightInfo;
44
+ #jumpToAddress?: (address: number) => void;
45
+ #deleteHighlight?: (highlightInfo: HighlightInfo) => void;
62
46
 
63
47
  set data(data: LinearMemoryHighlightChipListData) {
64
48
  this.#highlightedAreas = data.highlightInfos;
65
49
  this.#focusedMemoryHighlight = data.focusedMemoryHighlight;
50
+ this.#jumpToAddress = data.jumpToAddress;
51
+ this.#deleteHighlight = data.deleteHighlight;
66
52
  this.#render();
67
53
  }
68
54
 
69
55
  #render(): void {
70
56
  // Disabled until https://crbug.com/1079231 is fixed.
71
57
  // clang-format off
72
- const chips = [];
73
- for (const highlightInfo of this.#highlightedAreas) {
74
- chips.push(this.#createChip(highlightInfo));
75
- }
76
- const result = html`
77
- <style>${linearMemoryHighlightChipListStyles}</style>
78
- <div class="highlight-chip-list">
79
- ${chips}
80
- </div>
81
- `;
82
- render(result, this.#shadow, { host: this });
58
+ render(html`
59
+ <style>${linearMemoryHighlightChipListStyles}</style>
60
+ <div class="highlight-chip-list">
61
+ ${this.#highlightedAreas.map(highlightInfo => this.#createChip(highlightInfo))}
62
+ </div>`, this.#shadow);
83
63
  // clang-format on
84
64
  }
85
65
 
86
- #createChip(highlightInfo: HighlightInfo): Lit.TemplateResult {
66
+ #createChip(highlightInfo: HighlightInfo): TemplateResult {
87
67
  const expressionName = highlightInfo.name || '<anonymous>';
88
68
  const expressionType = highlightInfo.type;
89
69
  const isFocused = highlightInfo === this.#focusedMemoryHighlight;
90
- const classMap = {
91
- focused: isFocused,
92
- 'highlight-chip': true,
93
- };
94
70
  // Disabled until https://crbug.com/1079231 is fixed.
95
71
  // clang-format off
96
72
  return html`
97
- <div class=${Lit.Directives.classMap(classMap)}>
98
- <button class="jump-to-highlight-button" title=${i18nString(UIStrings.jumpToAddress)}
99
- jslog=${VisualLogging.action('linear-memory-inspector.jump-to-highlight').track({click:true})}
100
- @click=${():void => this.#onJumpToHighlightClick(highlightInfo.startAddress)}>
73
+ <div class=${classMap({focused: isFocused, 'highlight-chip': true})}>
74
+ <button class="jump-to-highlight-button"
75
+ title=${i18nString(UIStrings.jumpToAddress)}
76
+ jslog=${VisualLogging.action('linear-memory-inspector.jump-to-highlight')
77
+ .track({click:true})}
78
+ @click=${() => this.#onJumpToHighlightClick(highlightInfo.startAddress)}>
101
79
  <span class="source-code">
102
80
  <span class="value">${expressionName}</span>
103
81
  <span class="separator">: </span>
@@ -106,23 +84,23 @@ export class LinearMemoryHighlightChipList extends HTMLElement {
106
84
  </button>
107
85
  <div class="delete-highlight-container">
108
86
  <button class="delete-highlight-button" title=${i18nString(UIStrings.deleteHighlight)}
109
- jslog=${VisualLogging.action('linear-memory-inspector.delete-highlight').track({click:true})}
110
- @click=${():void => this.#onDeleteHighlightClick(highlightInfo)}>
87
+ jslog=${VisualLogging.action('linear-memory-inspector.delete-highlight')
88
+ .track({click:true})}
89
+ @click=${() => this.#onDeleteHighlightClick(highlightInfo)}>
111
90
  <devtools-icon name="cross" class="medium">
112
91
  </devtools-icon>
113
92
  </button>
114
93
  </div>
115
- </div>
116
- `;
94
+ </div>`;
117
95
  // clang-format off
118
96
  }
119
97
 
120
98
  #onJumpToHighlightClick(startAddress: number): void {
121
- this.dispatchEvent(new JumpToHighlightedMemoryEvent(startAddress));
99
+ this.#jumpToAddress?.(startAddress);
122
100
  }
123
101
 
124
- #onDeleteHighlightClick(highlight:HighlightInfo): void {
125
- this.dispatchEvent(new DeleteMemoryHighlightEvent(highlight));
102
+ #onDeleteHighlightClick(highlight: HighlightInfo): void {
103
+ this.#deleteHighlight?.(highlight);
126
104
  }
127
105
  }
128
106
 
@@ -11,7 +11,6 @@ import * as i18n from '../../../core/i18n/i18n.js';
11
11
  import * as UI from '../../../ui/legacy/legacy.js';
12
12
  import {html, nothing, render} from '../../../ui/lit/lit.js';
13
13
 
14
- import type {DeleteMemoryHighlightEvent, JumpToHighlightedMemoryEvent} from './LinearMemoryHighlightChipList.js';
15
14
  import linearMemoryInspectorStyles from './linearMemoryInspector.css.js';
16
15
  import {formatAddress, parseAddress} from './LinearMemoryInspectorUtils.js';
17
16
  import {
@@ -121,8 +120,8 @@ export interface ViewInput {
121
120
  onAddressChange: (e: AddressInputChangedEvent) => void;
122
121
  onNavigatePage: (e: PageNavigationEvent) => void;
123
122
  onNavigateHistory: (e: HistoryNavigationEvent) => boolean;
124
- onJumpToAddress: (e: JumpToPointerAddressEvent|JumpToHighlightedMemoryEvent) => void;
125
- onDeleteMemoryHighlight: (e: DeleteMemoryHighlightEvent) => void;
123
+ onJumpToAddress: (e: JumpToPointerAddressEvent|{data: number}) => void;
124
+ onDeleteMemoryHighlight: (info: HighlightInfo) => void;
126
125
  onByteSelected: (e: ByteSelectedEvent) => void;
127
126
  onResize: (e: ResizeEvent) => void;
128
127
  onValueTypeToggled: (e: ValueTypeToggledEvent) => void;
@@ -164,9 +163,13 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: Record<string, unknown>,
164
163
  @pagenavigation=${input.onNavigatePage}
165
164
  @historynavigation=${input.onNavigateHistory}></devtools-linear-memory-inspector-navigator>
166
165
  <devtools-linear-memory-highlight-chip-list
167
- .data=${{highlightInfos: highlightedMemoryAreas, focusedMemoryHighlight}}
168
- @jumptohighlightedmemory=${input.onJumpToAddress}
169
- @deletememoryhighlight=${input.onDeleteMemoryHighlight}>
166
+ .data=${{
167
+ highlightInfos: highlightedMemoryAreas,
168
+ focusedMemoryHighlight,
169
+ jumpToAddress: (address: number) => input.onJumpToAddress({data: address}),
170
+ deleteHighlight: input.onDeleteMemoryHighlight,
171
+ }}
172
+ >
170
173
  </devtools-linear-memory-highlight-chip-list>
171
174
  <devtools-linear-memory-inspector-viewer
172
175
  .data=${
@@ -376,17 +379,18 @@ export class LinearMemoryInspector extends Common.ObjectWrapper.eventMixin<Event
376
379
  this.#view(viewInput, {}, this.contentElement);
377
380
  }
378
381
 
379
- #onJumpToAddress(e: JumpToPointerAddressEvent|JumpToHighlightedMemoryEvent): void {
382
+ #onJumpToAddress(e: JumpToPointerAddressEvent|{data: number}): void {
380
383
  // Stop event from bubbling up, since no element further up needs the event.
381
- e.stopPropagation();
384
+ if (e instanceof Event) {
385
+ e.stopPropagation();
386
+ }
382
387
  this.#currentNavigatorMode = Mode.SUBMITTED;
383
388
  const addressInRange = Math.max(0, Math.min(e.data, this.#outerMemoryLength - 1));
384
389
  this.#jumpToAddress(addressInRange);
385
390
  }
386
391
 
387
- #onDeleteMemoryHighlight(e: DeleteMemoryHighlightEvent): void {
388
- e.stopPropagation();
389
- this.dispatchEventToListeners(Events.DELETE_MEMORY_HIGHLIGHT, e.data);
392
+ #onDeleteMemoryHighlight(highlight: HighlightInfo): void {
393
+ this.dispatchEventToListeners(Events.DELETE_MEMORY_HIGHLIGHT, highlight);
390
394
  }
391
395
 
392
396
  #onRefreshRequest(): void {
@@ -1,12 +1,13 @@
1
1
  // Copyright 2019 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-imperative-dom-api */
4
+
5
+ import '../../ui/components/icon_button/icon_button.js';
5
6
 
6
7
  import * as i18n from '../../core/i18n/i18n.js';
7
8
  import type * as Protocol from '../../generated/protocol.js';
8
- import * as IconButton from '../../ui/components/icon_button/icon_button.js';
9
9
  import * as UI from '../../ui/legacy/legacy.js';
10
+ import {Directives, html, render} from '../../ui/lit/lit.js';
10
11
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
11
12
 
12
13
  import type {MainView, TriggerDispatcher} from './MainView.js';
@@ -14,6 +15,8 @@ import type {PlayerEvent} from './MediaModel.js';
14
15
  import playerListViewStyles from './playerListView.css.js';
15
16
  import {PlayerPropertyKeys} from './PlayerPropertiesView.js';
16
17
 
18
+ const {classMap} = Directives;
19
+
17
20
  const UIStrings = {
18
21
  /**
19
22
  * @description A right-click context menu entry which when clicked causes the menu entry for that player to be removed.
@@ -34,76 +37,103 @@ const UIStrings = {
34
37
  } as const;
35
38
  const str_ = i18n.i18n.registerUIStrings('panels/media/PlayerListView.ts', UIStrings);
36
39
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
37
- export interface PlayerStatus {
40
+
41
+ interface PlayerStatus {
38
42
  playerTitle: string;
43
+ frameTitle: string;
39
44
  playerID: string;
40
45
  exists: boolean;
41
46
  playing: boolean;
42
47
  titleEdited: boolean;
48
+ iconName: string;
43
49
  }
44
- export interface PlayerStatusMapElement {
45
- playerStatus: PlayerStatus;
46
- playerTitleElement: HTMLElement|null;
50
+
51
+ export interface ViewInput {
52
+ players: PlayerStatus[];
53
+ selectedPlayerID: string|null;
54
+ onPlayerClick: (playerID: string) => void;
55
+ onPlayerContextMenu: (playerID: string, event: Event) => void;
47
56
  }
57
+ export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
58
+
59
+ const DEFAULT_VIEW: View = (input, _output, target) => {
60
+ // clang-format off
61
+ render(
62
+ html`
63
+ <style>${playerListViewStyles}</style>
64
+ <div class="player-entry-header">${i18nString(UIStrings.players)}</div>
65
+ ${input.players.map(player => {
66
+ const isSelected = player.playerID === input.selectedPlayerID;
67
+ return html`
68
+ <div class=${classMap({
69
+ 'player-entry-row': true,
70
+ hbox: true,
71
+ selected: isSelected,
72
+ 'force-white-icons': isSelected,
73
+ })}
74
+ @click=${() => input.onPlayerClick(player.playerID)}
75
+ @contextmenu=${(e: Event) => input.onPlayerContextMenu(player.playerID, e)}
76
+ jslog=${VisualLogging.item('player').track({click: true})}>
77
+ <div class="player-entry-status-icon vbox">
78
+ <div class="player-entry-status-icon-centering">
79
+ <devtools-icon name=${player.iconName}></devtools-icon>
80
+ </div>
81
+ </div>
82
+ <div class="player-entry-frame-title">${player.frameTitle}</div>
83
+ <div class="player-entry-player-title">${player.playerTitle}</div>
84
+ </div>
85
+ `;
86
+ })}
87
+ `,
88
+ target
89
+ );
90
+ // clang-format on
91
+ };
48
92
 
49
93
  export class PlayerListView extends UI.Widget.VBox implements TriggerDispatcher {
50
- private readonly playerEntryFragments: Map<string, UI.Fragment.Fragment>;
94
+ #view: View;
95
+ private readonly playerStatuses: Map<string, PlayerStatus>;
51
96
  private readonly playerEntriesWithHostnameFrameTitle: Set<string>;
52
97
  private readonly mainContainer: MainView;
53
- private currentlySelectedEntry: Element|null;
98
+ private currentlySelectedPlayerID: string|null;
54
99
 
55
- constructor(mainContainer: MainView) {
100
+ constructor(mainContainer: MainView, view: View = DEFAULT_VIEW) {
56
101
  super({useShadowDom: true});
57
- this.registerRequiredCSS(playerListViewStyles);
102
+ this.#view = view;
58
103
 
59
- this.playerEntryFragments = new Map();
104
+ this.playerStatuses = new Map();
60
105
  this.playerEntriesWithHostnameFrameTitle = new Set();
61
106
 
62
107
  // Container where new panels can be added based on clicks.
63
108
  this.mainContainer = mainContainer;
64
109
 
65
- this.currentlySelectedEntry = null;
66
- this.contentElement.createChild('div', 'player-entry-header').textContent = i18nString(UIStrings.players);
110
+ this.currentlySelectedPlayerID = null;
111
+ this.requestUpdate();
67
112
  }
68
113
 
69
- private createPlayerListEntry(playerID: string): UI.Fragment.Fragment {
70
- const entry = UI.Fragment.Fragment.build`
71
- <div class="player-entry-row hbox">
72
- <div class="player-entry-status-icon vbox">
73
- <div $="icon" class="player-entry-status-icon-centering"></div>
74
- </div>
75
- <div $="frame-title" class="player-entry-frame-title">FrameTitle</div>
76
- <div $="player-title" class="player-entry-player-title">PlayerTitle</div>
77
- </div>
78
- `;
79
- const element = entry.element();
80
- element.setAttribute('jslog', `${VisualLogging.item('player').track({click: true})}`);
81
- element.addEventListener('click', this.selectPlayer.bind(this, playerID, element));
82
- element.addEventListener('contextmenu', this.rightClickPlayer.bind(this, playerID));
83
-
84
- entry.$('icon').appendChild(IconButton.Icon.create('pause', 'media-player'));
85
- return entry;
114
+ override performUpdate(): void {
115
+ const input: ViewInput = {
116
+ players: Array.from(this.playerStatuses.values()),
117
+ selectedPlayerID: this.currentlySelectedPlayerID,
118
+ onPlayerClick: this.selectPlayer.bind(this),
119
+ onPlayerContextMenu: this.rightClickPlayer.bind(this),
120
+ };
121
+ this.#view(input, {}, this.contentElement);
86
122
  }
87
123
 
88
124
  selectPlayerById(playerID: string): void {
89
- const fragment = this.playerEntryFragments.get(playerID);
90
- if (fragment) {
91
- this.selectPlayer(playerID, fragment.element());
125
+ if (this.playerStatuses.has(playerID)) {
126
+ this.selectPlayer(playerID);
92
127
  }
93
128
  }
94
129
 
95
- private selectPlayer(playerID: string, element: Element): void {
130
+ private selectPlayer(playerID: string): void {
96
131
  this.mainContainer.renderMainPanel(playerID);
97
- if (this.currentlySelectedEntry !== null) {
98
- this.currentlySelectedEntry.classList.remove('selected');
99
- this.currentlySelectedEntry.classList.remove('force-white-icons');
100
- }
101
- element.classList.add('selected');
102
- element.classList.add('force-white-icons');
103
- this.currentlySelectedEntry = element;
132
+ this.currentlySelectedPlayerID = playerID;
133
+ this.requestUpdate();
104
134
  }
105
135
 
106
- private rightClickPlayer(playerID: string, event: Event): boolean {
136
+ private rightClickPlayer(playerID: string, event: Event): void {
107
137
  const contextMenu = new UI.ContextMenu.ContextMenu(event);
108
138
  contextMenu.headerSection().appendItem(
109
139
  i18nString(UIStrings.hidePlayer), this.mainContainer.markPlayerForDeletion.bind(this.mainContainer, playerID),
@@ -116,7 +146,6 @@ export class PlayerListView extends UI.Widget.VBox implements TriggerDispatcher
116
146
  i18nString(UIStrings.savePlayerInfo), this.mainContainer.exportPlayerData.bind(this.mainContainer, playerID),
117
147
  {jslogContext: 'save-player-info'});
118
148
  void contextMenu.show();
119
- return true;
120
149
  }
121
150
 
122
151
  private setMediaElementFrameTitle(playerID: string, frameTitle: string, isHostname: boolean): void {
@@ -131,41 +160,36 @@ export class PlayerListView extends UI.Widget.VBox implements TriggerDispatcher
131
160
  return;
132
161
  }
133
162
 
134
- if (!this.playerEntryFragments.has(playerID)) {
163
+ if (!this.playerStatuses.has(playerID)) {
135
164
  return;
136
165
  }
137
- const fragment = this.playerEntryFragments.get(playerID);
138
- if (fragment?.element() === undefined) {
139
- return;
166
+ const playerStatus = this.playerStatuses.get(playerID);
167
+ if (playerStatus) {
168
+ playerStatus.frameTitle = frameTitle;
169
+ this.requestUpdate();
140
170
  }
141
- fragment.$('frame-title').textContent = frameTitle;
142
171
  }
143
172
 
144
173
  private setMediaElementPlayerTitle(playerID: string, playerTitle: string): void {
145
- if (!this.playerEntryFragments.has(playerID)) {
174
+ if (!this.playerStatuses.has(playerID)) {
146
175
  return;
147
176
  }
148
- const fragment = this.playerEntryFragments.get(playerID);
149
- if (fragment === undefined) {
150
- return;
177
+ const playerStatus = this.playerStatuses.get(playerID);
178
+ if (playerStatus) {
179
+ playerStatus.playerTitle = playerTitle;
180
+ this.requestUpdate();
151
181
  }
152
- fragment.$('player-title').textContent = playerTitle;
153
182
  }
154
183
 
155
184
  private setMediaElementPlayerIcon(playerID: string, iconName: string): void {
156
- if (!this.playerEntryFragments.has(playerID)) {
157
- return;
158
- }
159
- const fragment = this.playerEntryFragments.get(playerID);
160
- if (fragment === undefined) {
185
+ if (!this.playerStatuses.has(playerID)) {
161
186
  return;
162
187
  }
163
- const icon = fragment.$('icon');
164
- if (icon === undefined) {
165
- return;
188
+ const playerStatus = this.playerStatuses.get(playerID);
189
+ if (playerStatus) {
190
+ playerStatus.iconName = iconName;
191
+ this.requestUpdate();
166
192
  }
167
- icon.textContent = '';
168
- icon.appendChild(IconButton.Icon.create(iconName, 'media-player'));
169
193
  }
170
194
 
171
195
  private formatAndEvaluate(
@@ -180,22 +204,25 @@ export class PlayerListView extends UI.Widget.VBox implements TriggerDispatcher
180
204
  }
181
205
 
182
206
  addMediaElementItem(playerID: string): void {
183
- const sidebarEntry = this.createPlayerListEntry(playerID);
184
- this.contentElement.appendChild(sidebarEntry.element());
185
- this.playerEntryFragments.set(playerID, sidebarEntry);
207
+ this.playerStatuses.set(playerID, {
208
+ playerTitle: 'PlayerTitle',
209
+ frameTitle: 'FrameTitle',
210
+ playerID,
211
+ exists: true,
212
+ playing: false,
213
+ titleEdited: false,
214
+ iconName: 'pause',
215
+ });
186
216
  this.playerEntriesWithHostnameFrameTitle.add(playerID);
217
+ this.requestUpdate();
187
218
  }
188
219
 
189
220
  deletePlayer(playerID: string): void {
190
- if (!this.playerEntryFragments.has(playerID)) {
191
- return;
192
- }
193
- const fragment = this.playerEntryFragments.get(playerID);
194
- if (fragment?.element() === undefined) {
221
+ if (!this.playerStatuses.has(playerID)) {
195
222
  return;
196
223
  }
197
- this.contentElement.removeChild(fragment.element());
198
- this.playerEntryFragments.delete(playerID);
224
+ this.playerStatuses.delete(playerID);
225
+ this.requestUpdate();
199
226
  }
200
227
 
201
228
  onEvent(playerID: string, event: PlayerEvent): void {
@@ -43,6 +43,11 @@ li.storage-group-list-item::before {
43
43
  .player-entry-status-icon-centering {
44
44
  margin: auto;
45
45
  display: inherit;
46
+
47
+ & > devtools-icon {
48
+ height: 16px;
49
+ width: 16px;
50
+ }
46
51
  }
47
52
 
48
53
  .player-entry-status-icon {
@@ -3,14 +3,14 @@
3
3
  // found in the LICENSE file.
4
4
  /* eslint-disable @devtools/no-imperative-dom-api */
5
5
 
6
- import '../../ui/components/cards/cards.js';
6
+ import '../../ui/kit/kit.js';
7
7
 
8
8
  import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as SDK from '../../core/sdk/sdk.js';
11
11
  import * as Buttons from '../../ui/components/buttons/buttons.js';
12
- import type * as Cards from '../../ui/components/cards/cards.js';
13
12
  import * as IconButton from '../../ui/components/icon_button/icon_button.js';
13
+ import type {Card} from '../../ui/kit/kit.js';
14
14
  import * as UI from '../../ui/legacy/legacy.js';
15
15
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
16
16
 
@@ -198,7 +198,7 @@ function createComputePressurePromise(): Promise<{state: string}> {
198
198
  }
199
199
 
200
200
  export class CPUThrottlingCard {
201
- element: Cards.Card.Card;
201
+ element: Card;
202
202
 
203
203
  private readonly setting: Common.Settings.Setting<SDK.CPUThrottlingManager.CalibratedCPUThrottling>;
204
204
  private computePressurePromise?: ReturnType<typeof createComputePressurePromise>;
@@ -86,9 +86,8 @@ const UIStrings = {
86
86
  textPatternToBlockMatching: 'Text pattern to block matching requests; use * for wildcard',
87
87
  /**
88
88
  * @description Text in Blocked URLs Pane of the Network panel
89
- * @example {Learn more} PH1
90
89
  */
91
- textEditPattern: 'Text pattern to block or throttle matching requests; use URL Pattern syntax. {PH1}',
90
+ textEditPattern: 'Text pattern to block or throttle matching requests; use URL Pattern syntax.',
92
91
  /**
93
92
  * @description Error text for empty list widget input in Request Blocking tool
94
93
  */
@@ -449,7 +448,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
449
448
  <devtools-button
450
449
  .iconName=${'arrow-up'}
451
450
  .variant=${Buttons.Button.Variant.ICON}
452
- .title=${i18nString(UIStrings.decreasePriority, {PH1: constructorStringOrWildcardURL})}
451
+ .title=${i18nString(UIStrings.increasePriority, {PH1: constructorStringOrWildcardURL})}
453
452
  .jslogContext=${'decrease-priority'}
454
453
  ?disabled=${!editable || !originalOrUpgradedURLPattern}
455
454
  @click=${moveUp}>
@@ -457,7 +456,7 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
457
456
  <devtools-button
458
457
  .iconName=${'arrow-down'}
459
458
  .variant=${Buttons.Button.Variant.ICON}
460
- .title=${i18nString(UIStrings.increasePriority, {PH1: constructorStringOrWildcardURL})}
459
+ .title=${i18nString(UIStrings.decreasePriority, {PH1: constructorStringOrWildcardURL})}
461
460
  .jslogContext=${'increase-priority'}
462
461
  ?disabled=${!editable || !originalOrUpgradedURLPattern}
463
462
  @click=${moveDown}></devtools-button>
@@ -579,7 +578,8 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
579
578
  const learnMore = UI.XLink.XLink.create(
580
579
  PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');
581
580
  learnMore.title = i18nString(UIStrings.learnMoreLabel);
582
- label.append(uiI18n.getFormatLocalizedString(str_, UIStrings.textEditPattern, {PH1: learnMore}));
581
+ titles.append('\xA0', learnMore);
582
+ label.textContent = i18nString(UIStrings.textEditPattern);
583
583
  } else {
584
584
  label.textContent = i18nString(UIStrings.textPatternToBlockMatching);
585
585
  }
@@ -68,6 +68,10 @@ const UIStrings = {
68
68
  * @description Text in Connection info View of the Network panel
69
69
  */
70
70
  directSocketStatusAborted: 'Aborted',
71
+ /**
72
+ * @description Text in Connection info View of the Network panel
73
+ */
74
+ joinedMulticastGroups: 'joinedMulticastGroups',
71
75
 
72
76
  } as const;
73
77
 
@@ -167,6 +171,10 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
167
171
  ${renderRow(i18nString(UIStrings.type), getDirectSocketTypeString(socketInfo.type))}
168
172
  ${renderRow(i18nString(UIStrings.status), getDirectSocketStatusString(socketInfo.status))}
169
173
  ${renderRow(i18nString(UIStrings.errorMessage), socketInfo.errorMessage)}
174
+ ${
175
+ renderRow(
176
+ i18nString(UIStrings.joinedMulticastGroups),
177
+ socketInfo.joinedMulticastGroups ? Array.from(socketInfo.joinedMulticastGroups).join(', ') : '')}
170
178
  </div>`;
171
179
 
172
180
  const optionsContent = html`
@@ -181,6 +189,15 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
181
189
  ${
182
190
  renderRow(i18n.i18n.lockedString('receiveBufferSize'), socketInfo.createOptions.receiveBufferSize?.toString(10))}
183
191
  ${renderRow(i18n.i18n.lockedString('dnsQueryType'), socketInfo.createOptions.dnsQueryType)}
192
+ ${
193
+ renderRow(
194
+ i18n.i18n.lockedString('multicastTimeToLive'), socketInfo.createOptions.multicastTimeToLive?.toString(10))}
195
+ ${
196
+ renderRow(i18n.i18n.lockedString('multicastLoopback'), socketInfo.createOptions.multicastLoopback?.toString())}
197
+ ${
198
+ renderRow(
199
+ i18n.i18n.lockedString('multicastAllowAddressSharing'),
200
+ socketInfo.createOptions.multicastAllowAddressSharing?.toString())}
184
201
  </div>`;
185
202
 
186
203
  let openInfoContent: Lit.LitTemplate = Lit.nothing;
@@ -12,6 +12,10 @@
12
12
  flex: auto;
13
13
  border: none;
14
14
 
15
+ .resource-chunk-view-td {
16
+ border-bottom: 1px solid var(--sys-color-divider);
17
+ }
18
+
15
19
  & tr {
16
20
  &.resource-chunk-view-row-send td:first-child::before {
17
21
  content: "\2B06";
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import '../../ui/components/switch/switch.js';
6
- import '../../ui/components/cards/cards.js';
6
+ import '../../ui/kit/kit.js';
7
7
  import '../../ui/components/chrome_link/chrome_link.js';
8
8
 
9
9
  import * as Common from '../../core/common/common.js';