chrome-devtools-frontend 1.0.1681091 → 1.0.1682249

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 (208) hide show
  1. package/eslint.config.mjs +8 -3
  2. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  3. package/front_end/core/sdk/DOMModel.ts +8 -0
  4. package/front_end/core/sdk/NetworkManager.ts +9 -4
  5. package/front_end/core/sdk/OverlayModel.ts +3 -2
  6. package/front_end/core/sdk/PreloadingModel.ts +44 -22
  7. package/front_end/core/sdk/RemoteObject.ts +4 -1
  8. package/front_end/core/sdk/RuntimeModel.ts +5 -5
  9. package/front_end/core/sdk/SDKSettings.ts +19 -0
  10. package/front_end/core/sdk/sdk.ts +2 -0
  11. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
  12. package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
  13. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -5
  14. package/front_end/entrypoints/main/MainImpl.ts +9 -10
  15. package/front_end/entrypoints/main/main-meta.ts +82 -0
  16. package/front_end/entrypoints/shell/shell.ts +0 -5
  17. package/front_end/entrypoints/trace_app/trace_app.ts +0 -5
  18. package/front_end/generated/InspectorBackendCommands.ts +2 -0
  19. package/front_end/generated/protocol-mapping.d.ts +16 -0
  20. package/front_end/generated/protocol-proxy-api.d.ts +12 -0
  21. package/front_end/generated/protocol.ts +12 -0
  22. package/front_end/models/ai_assistance/ExtensionScope.ts +11 -12
  23. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -1
  24. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -1
  25. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
  26. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
  27. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +2 -1
  28. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +8 -8
  29. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
  30. package/front_end/models/ai_code_completion/debug.ts +6 -3
  31. package/front_end/models/ai_code_generation/debug.ts +6 -3
  32. package/front_end/models/badges/UserBadges.ts +9 -2
  33. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -0
  34. package/front_end/models/emulation/DeviceModeModel.ts +16 -27
  35. package/front_end/models/emulation/EmulatedDevices.ts +30 -125
  36. package/front_end/models/extensions/ExtensionAPI.ts +34 -23
  37. package/front_end/models/formatter/ScriptFormatter.ts +1 -0
  38. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
  39. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +4 -4
  40. package/front_end/models/logs/NetworkLog.ts +11 -4
  41. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +4 -2
  42. package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -1
  43. package/front_end/models/stack_trace/StackTraceImpl.ts +1 -0
  44. package/front_end/models/trace/Name.ts +5 -5
  45. package/front_end/models/trace/Styles.ts +115 -115
  46. package/front_end/models/trace/extras/TraceTree.ts +2 -1
  47. package/front_end/models/trace/helpers/Network.ts +4 -1
  48. package/front_end/models/trace/insights/CLSCulprits.ts +4 -2
  49. package/front_end/models/trace/insights/CharacterSet.ts +3 -3
  50. package/front_end/models/trace/insights/DOMSize.ts +1 -1
  51. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +6 -2
  52. package/front_end/models/trace/insights/FontDisplay.ts +9 -3
  53. package/front_end/models/trace/insights/ForcedReflow.ts +4 -4
  54. package/front_end/models/trace/insights/INPBreakdown.ts +3 -4
  55. package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
  56. package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
  57. package/front_end/models/trace/insights/LCPDiscovery.ts +5 -5
  58. package/front_end/models/trace/insights/LegacyJavaScript.ts +7 -3
  59. package/front_end/models/trace/insights/ModernHTTP.ts +3 -3
  60. package/front_end/models/trace/insights/NetworkDependencyTree.ts +13 -9
  61. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  62. package/front_end/models/trace/insights/SlowCSSSelector.ts +29 -25
  63. package/front_end/models/trace/insights/ThirdParties.ts +13 -5
  64. package/front_end/models/trace/insights/Viewport.ts +4 -2
  65. package/front_end/models/workspace/IgnoreListManager.ts +53 -17
  66. package/front_end/panels/accessibility/ARIAAttributesView.ts +11 -2
  67. package/front_end/panels/ai_assistance/components/ChatMessage.ts +67 -53
  68. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
  69. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +2 -2
  70. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +5 -5
  71. package/front_end/panels/animation/AnimationTimeline.ts +2 -0
  72. package/front_end/panels/application/ServiceWorkersView.ts +1 -1
  73. package/front_end/panels/application/StorageView.ts +2 -0
  74. package/front_end/panels/application/preloading/PreloadingView.ts +9 -3
  75. package/front_end/panels/application/preloading/components/components.ts +2 -0
  76. package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +10 -11
  77. package/front_end/panels/changes/CombinedDiffView.ts +1 -1
  78. package/front_end/panels/common/BadgeNotification.ts +1 -1
  79. package/front_end/panels/common/ExtensionPanel.ts +12 -7
  80. package/front_end/panels/common/ExtensionServer.ts +85 -26
  81. package/front_end/panels/common/GdpSignUpDialog.ts +1 -1
  82. package/front_end/panels/console/ConsoleView.ts +2 -1
  83. package/front_end/panels/console/ConsoleViewMessage.ts +3 -2
  84. package/front_end/panels/console/console-meta.ts +9 -0
  85. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +9 -4
  86. package/front_end/panels/elements/CSSRuleValidator.ts +12 -12
  87. package/front_end/panels/elements/CSSSpecificityBreakdown.ts +1 -1
  88. package/front_end/panels/elements/ClassesPaneWidget.ts +6 -6
  89. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
  90. package/front_end/panels/elements/ComputedStyleWidget.ts +4 -5
  91. package/front_end/panels/elements/DOMTreeContextMenu.ts +3 -6
  92. package/front_end/panels/elements/ElementIssueUtils.ts +20 -20
  93. package/front_end/panels/elements/ElementStatePaneWidget.ts +9 -6
  94. package/front_end/panels/elements/ElementsPanel.ts +10 -10
  95. package/front_end/panels/elements/ElementsTreeElement.ts +35 -29
  96. package/front_end/panels/elements/ElementsTreeOutline.ts +5 -20
  97. package/front_end/panels/elements/EventListenersWidget.ts +18 -19
  98. package/front_end/panels/elements/LayersWidget.ts +4 -4
  99. package/front_end/panels/elements/LayoutPane.ts +11 -11
  100. package/front_end/panels/elements/MarkerDecorator.ts +3 -3
  101. package/front_end/panels/elements/PlatformFontsWidget.ts +8 -8
  102. package/front_end/panels/elements/PropertiesWidget.ts +4 -4
  103. package/front_end/panels/elements/PropertyRenderer.ts +2 -2
  104. package/front_end/panels/elements/ShortcutTreeElement.ts +1 -1
  105. package/front_end/panels/elements/StylePropertiesSection.ts +14 -14
  106. package/front_end/panels/elements/StylePropertyTreeElement.ts +21 -21
  107. package/front_end/panels/elements/StylesSidebarPane.ts +12 -13
  108. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +1 -1
  109. package/front_end/panels/elements/components/CSSHintDetailsView.ts +1 -1
  110. package/front_end/panels/elements/components/CSSVariableValueView.ts +3 -3
  111. package/front_end/panels/elements/components/ElementsBreadcrumbsUtils.ts +2 -2
  112. package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
  113. package/front_end/panels/elements/elements-meta.ts +13 -13
  114. package/front_end/panels/issues/AffectedCookiesView.ts +2 -0
  115. package/front_end/panels/issues/AffectedElementsView.ts +5 -0
  116. package/front_end/panels/issues/IssueView.ts +12 -8
  117. package/front_end/panels/layer_viewer/LayerDetailsView.ts +11 -7
  118. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +2 -0
  119. package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
  120. package/front_end/panels/media/PlayerPropertiesView.ts +309 -416
  121. package/front_end/panels/media/playerPropertiesView.css +1 -1
  122. package/front_end/panels/network/NetworkLogView.ts +5 -2
  123. package/front_end/panels/network/NetworkOverview.ts +11 -5
  124. package/front_end/panels/network/NetworkPanel.ts +4 -2
  125. package/front_end/panels/network/NetworkWaterfallColumn.ts +16 -3
  126. package/front_end/panels/network/RequestHeadersView.ts +4 -4
  127. package/front_end/panels/network/components/ResponseHeaderSection.ts +7 -4
  128. package/front_end/panels/network/network-meta.ts +63 -0
  129. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -1
  130. package/front_end/panels/recorder/RecordingView.ts +89 -73
  131. package/front_end/panels/recorder/ReplaySection.ts +59 -40
  132. package/front_end/panels/recorder/injected/injected.ts +4 -0
  133. package/front_end/panels/security/SecurityPanel.ts +5 -6
  134. package/front_end/panels/security/SecurityPanelSidebar.ts +244 -204
  135. package/front_end/panels/security/security.ts +0 -4
  136. package/front_end/panels/settings/EditFileSystemView.ts +8 -7
  137. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -14
  138. package/front_end/panels/settings/components/SyncSection.ts +1 -1
  139. package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +0 -3
  140. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +10 -11
  141. package/front_end/panels/sources/NavigatorView.ts +6 -2
  142. package/front_end/panels/sources/SourcesNavigator.ts +8 -4
  143. package/front_end/panels/sources/SourcesPanel.ts +4 -2
  144. package/front_end/panels/sources/SourcesSearchScope.ts +3 -1
  145. package/front_end/panels/sources/UISourceCodeFrame.ts +2 -2
  146. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -3
  147. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +5 -5
  148. package/front_end/panels/timeline/components/CWVMetrics.ts +1 -2
  149. package/front_end/panels/timeline/components/IgnoreListSetting.ts +5 -5
  150. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -3
  151. package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
  152. package/front_end/panels/timeline/components/Sidebar.ts +3 -3
  153. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -2
  154. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +3 -1
  155. package/front_end/panels/timeline/components/insights/CLSCulprits.ts +1 -2
  156. package/front_end/panels/timeline/components/insights/Cache.ts +1 -2
  157. package/front_end/panels/timeline/components/insights/CharacterSet.ts +1 -2
  158. package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -2
  159. package/front_end/panels/timeline/components/insights/DocumentLatency.ts +2 -2
  160. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
  161. package/front_end/panels/timeline/components/insights/FontDisplay.ts +1 -2
  162. package/front_end/panels/timeline/components/insights/ForcedReflow.ts +1 -2
  163. package/front_end/panels/timeline/components/insights/INPBreakdown.ts +1 -2
  164. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -2
  165. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +13 -13
  166. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +1 -2
  167. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +4 -4
  168. package/front_end/panels/timeline/components/insights/ModernHTTP.ts +1 -2
  169. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +10 -8
  170. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
  171. package/front_end/panels/timeline/components/insights/SidebarInsight.ts +3 -1
  172. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  173. package/front_end/panels/timeline/components/insights/ThirdParties.ts +1 -2
  174. package/front_end/panels/timeline/components/insights/Viewport.ts +1 -2
  175. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -2
  176. package/front_end/panels/timeline/timeline.ts +0 -2
  177. package/front_end/panels/web_audio/WebAudioView.ts +14 -6
  178. package/front_end/panels/webauthn/WebauthnPane.ts +9 -9
  179. package/front_end/third_party/chromium/README.chromium +1 -1
  180. package/front_end/third_party/web-vitals/rebuild.sh +1 -1
  181. package/front_end/ui/components/diff_view/DiffView.ts +2 -1
  182. package/front_end/ui/components/report_view/ReportView.docs.ts +2 -2
  183. package/front_end/ui/components/text_editor/javascript.ts +12 -13
  184. package/front_end/ui/legacy/GlassPane.ts +38 -14
  185. package/front_end/ui/legacy/Treeoutline.ts +14 -3
  186. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +11 -11
  187. package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -1
  188. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +19 -20
  189. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +1 -1
  190. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +1 -1
  191. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +3 -3
  192. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +185 -355
  193. package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +3 -8
  194. package/front_end/ui/legacy/components/utils/ImagePreview.ts +15 -16
  195. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +4 -4
  196. package/front_end/ui/legacy/components/utils/Linkifier.ts +8 -10
  197. package/front_end/ui/settings/InspectorMainSettings.ts +12 -0
  198. package/front_end/ui/settings/settings.ts +2 -0
  199. package/front_end/ui/visual_logging/KnownContextValues.ts +32 -0
  200. package/mcp/mcp.ts +0 -9
  201. package/package.json +1 -1
  202. package/front_end/core/sdk/sdk-meta.ts +0 -40
  203. package/front_end/models/badges/badges-meta.ts +0 -27
  204. package/front_end/models/logs/logs-meta.ts +0 -84
  205. package/front_end/models/persistence/persistence-meta.ts +0 -69
  206. package/front_end/models/workspace/workspace-meta.ts +0 -40
  207. package/front_end/panels/security/OriginTreeElement.ts +0 -60
  208. package/front_end/panels/security/SecurityPanelSidebarTreeElement.ts +0 -30
@@ -68,92 +68,83 @@ const {widget, widgetRef} = UI.Widget;
68
68
  const {ref, repeat, ifDefined, classMap} = Directives;
69
69
  const UIStrings = {
70
70
  /**
71
- * @description Text in Object Properties Section
71
+ * @description Text shown in an object properties tree when evaluating a property throws an exception.
72
72
  * @example {function alert() [native code] } PH1
73
73
  */
74
74
  exceptionS: '[Exception: {PH1}]',
75
75
  /**
76
- * @description Text in Object Properties Section
76
+ * @description Placeholder text shown for a property value whose type or value is unknown.
77
77
  */
78
78
  unknown: 'unknown',
79
79
  /**
80
- * @description Text to expand something recursively
80
+ * @description Context menu item to expand an object and all of its child properties recursively.
81
81
  */
82
82
  expandRecursively: 'Expand recursively',
83
83
  /**
84
- * @description Text to collapse children of a parent group
84
+ * @description Context menu item to collapse all child properties of an object.
85
85
  */
86
86
  collapseChildren: 'Collapse children',
87
87
  /**
88
- * @description A context menu item in the Object Properties Section to choose property ordering.
88
+ * @description Context menu item to sort object properties alphabetically.
89
89
  */
90
90
  sortPropertiesAlphabetically: 'Sort properties alphabetically',
91
91
  /**
92
- * @description Text in Object Properties Section
92
+ * @description Message displayed in an object properties tree when an object has no properties.
93
93
  */
94
94
  noProperties: 'No properties',
95
95
  /**
96
- * @description Element text content in Object Properties Section
96
+ * @description Placeholder text indicating more content or an invocable getter in an object properties tree.
97
97
  */
98
98
  dots: '(...)',
99
99
  /**
100
- * @description Element title in Object Properties Section
100
+ * @description Tooltip text for the button that invokes an object property getter.
101
101
  */
102
102
  invokePropertyGetter: 'Invoke property getter',
103
103
  /**
104
- * @description Show all text content in Show More Data Grid Node of a data grid
104
+ * @description Tooltip text on a button to expand and show all hidden child properties.
105
105
  * @example {50} PH1
106
106
  */
107
107
  showAllD: 'Show all {PH1}',
108
108
  /**
109
- * @description Show all properties including those with null or undefined values
109
+ * @description Context menu checkbox item to show all properties, including null and undefined values.
110
110
  */
111
111
  showAll: 'Show all',
112
112
  /**
113
- * @description Value element text content in Object Properties Section. Shown when the developer is
114
- * viewing a variable in the Scope view, whose value is not available (i.e. because it was optimized
115
- * out) by the JavaScript engine, or inspecting a JavaScript object accessor property, which has no
116
- * getter. This string should be translated.
113
+ * @description Text shown when a variable or property value is unavailable, such as when optimized out by the JavaScript engine or missing a getter.
117
114
  */
118
115
  valueUnavailable: '<value unavailable>',
119
116
  /**
120
- * @description Tooltip for value elements in the Scope view that refer to variables whose values
121
- * aren't accessible to the debugger (potentially due to being optimized out by the JavaScript
122
- * engine), or for JavaScript object accessor properties which have no getter.
117
+ * @description Tooltip text for property values that aren't accessible to the debugger.
123
118
  */
124
- valueNotAccessibleToTheDebugger: 'Value is not accessible to the debugger',
119
+ valueNotAccessibleToTheDebugger: 'Value isn’t accessible to the debugger',
125
120
  /**
126
- * @description A context menu item in the Watch Expressions Sidebar Pane of the Sources panel and Network pane request.
121
+ * @description Context menu item to copy the value of a property to the clipboard.
127
122
  */
128
123
  copyValue: 'Copy value',
129
124
  /**
130
- * @description A context menu item in the Object Properties Section
125
+ * @description Context menu item to copy the property path of an object property to the clipboard.
131
126
  */
132
127
  copyPropertyPath: 'Copy property path',
133
128
  /**
134
- * @description Text shown when displaying a JavaScript object that has a string property that is
135
- * too large for DevTools to properly display a text editor. This is shown instead of the string in
136
- * question. Should be translated.
129
+ * @description Placeholder text shown when a string property is too large to display in a text editor.
137
130
  */
138
131
  stringIsTooLargeToEdit: '<string is too large to edit>',
139
132
  /**
140
- * @description Text of attribute value when text is too long
133
+ * @description Context menu item and button text to expand truncated long text and show the remaining size.
141
134
  * @example {30 MB} PH1
142
135
  */
143
136
  showMoreS: 'Show more ({PH1})',
144
137
  /**
145
- * @description Text of attribute value when text is too long
138
+ * @description Button text indicating that a long text string was truncated and showing its total size.
146
139
  * @example {30 MB} PH1
147
140
  */
148
- longTextWasTruncatedS: 'long text was truncated ({PH1})',
141
+ longTextWasTruncatedS: 'Long text was truncated ({PH1})',
149
142
  /**
150
- * @description Text for copying
143
+ * @description Button and context menu item to copy text to the clipboard.
151
144
  */
152
145
  copy: 'Copy',
153
146
  /**
154
- * @description A tooltip text that shows when hovering over a button next to value objects,
155
- * which are based on bytes and can be shown in a hexadecimal viewer.
156
- * Clicking on the button will display that object in the Memory inspector panel.
147
+ * @description Tooltip text for the button to open a memory buffer object in the Memory inspector panel.
157
148
  */
158
149
  openInMemoryInpector: 'Open in Memory inspector panel',
159
150
  } as const;
@@ -161,7 +152,6 @@ const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/object_ui/ObjectP
161
152
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
162
153
  export const EXPANDABLE_MAX_DEPTH = 100;
163
154
 
164
- const objectPropertiesSectionMap = new WeakMap<Element, ObjectPropertiesSection>();
165
155
  // TODO(crbug.com/457388389): This cache is a temporary workaround for the <devtools-tree> migration.
166
156
  // It can be removed once the entire ObjectPropertiesSection is fully migrated to Lit and
167
157
  // the legacy TreeOutline/TreeElement dependencies are removed.
@@ -621,7 +611,7 @@ export abstract class ObjectTreeNodeBase extends Common.ObjectWrapper.ObjectWrap
621
611
  propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
622
612
  }));
623
613
  properties?.push(...this.extraProperties);
624
- properties?.sort((a, b) => ObjectPropertiesSection.compareProperties(a, b, this.sortPropertiesAlphabetically));
614
+ properties?.sort((a, b) => compareProperties(a, b, this.sortPropertiesAlphabetically));
625
615
  const accessors = properties && ObjectTreeNodeBase.getGettersAndSetters(properties, this.options);
626
616
 
627
617
  const internalProperties =
@@ -751,7 +741,7 @@ export class ArrayGroupTreeNode extends ObjectTreeNodeBase {
751
741
  ...this.options,
752
742
  }));
753
743
  properties?.push(...this.extraProperties);
754
- properties?.sort((a, b) => ObjectPropertiesSection.compareProperties(a, b, this.sortPropertiesAlphabetically));
744
+ properties?.sort((a, b) => compareProperties(a, b, this.sortPropertiesAlphabetically));
755
745
  const accessors = properties && ObjectTreeNodeBase.getGettersAndSetters(properties, this.options);
756
746
  return {properties, accessors};
757
747
  }
@@ -929,267 +919,179 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
929
919
  }
930
920
  }
931
921
 
932
- export const getObjectPropertiesSectionFrom = (element: Element): ObjectPropertiesSection|undefined => {
933
- return objectPropertiesSectionMap.get(element);
934
- };
935
-
936
- export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow {
937
- readonly root: ObjectTree;
938
- readonly #objectTreeElement: RootElement;
939
- titleElement: Element;
940
- skipProtoInternal?: boolean;
941
-
942
- constructor(object: SDK.RemoteObject.RemoteObject, title?: string|Element|null,
943
- linkifier?: Components.Linkifier.Linkifier, showOverflow?: boolean, editable = true,
944
- search?: UI.TreeOutline.TreeSearch<ObjectTreeNodeBase>) {
945
- super();
946
- this.root = new ObjectTree(object, {
947
- readOnly: !editable,
948
- propertiesMode: ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
949
- search,
950
- });
951
- if (!showOverflow) {
952
- this.setHideOverflow(true);
953
- }
954
- this.setFocusable(true);
955
- this.setShowSelectionOnKeyboardFocus(true);
956
- this.#objectTreeElement = new RootElement(this.root, linkifier);
957
- this.appendChild(this.#objectTreeElement);
958
- if (typeof title === 'string' || !title) {
959
- this.titleElement = this.element.createChild('span');
960
- this.titleElement.textContent = title ? Platform.StringUtilities.escapeUnicodeAsText(title) : '';
961
- } else {
962
- this.titleElement = title;
963
- this.element.appendChild(title);
964
- }
965
- if (this.titleElement instanceof HTMLElement && !this.titleElement.hasAttribute('tabIndex')) {
966
- this.titleElement.tabIndex = -1;
967
- }
968
-
969
- objectPropertiesSectionMap.set(this.element, this);
970
- this.registerRequiredCSS(objectValueStyles, objectPropertiesSectionStyles);
971
- this.rootElement().childrenListElement.classList.add('source-code', 'object-properties-section');
922
+ // The RemoteObjectProperty overload is kept for web test compatibility for now.
923
+ export function compareProperties(propertyA: ObjectTreeNode|SDK.RemoteObject.RemoteObjectProperty,
924
+ propertyB: ObjectTreeNode|SDK.RemoteObject.RemoteObjectProperty,
925
+ sortPropertiesAlphabetically = true): number {
926
+ if (propertyA instanceof ObjectTreeNode) {
927
+ propertyA = propertyA.property;
928
+ }
929
+ if (propertyB instanceof ObjectTreeNode) {
930
+ propertyB = propertyB.property;
972
931
  }
973
932
 
974
- // The RemoteObjectProperty overload is kept for web test compatibility for now.
975
- static compareProperties(propertyA: ObjectTreeNode|SDK.RemoteObject.RemoteObjectProperty,
976
- propertyB: ObjectTreeNode|SDK.RemoteObject.RemoteObjectProperty,
977
- sortPropertiesAlphabetically = true): number {
978
- if (propertyA instanceof ObjectTreeNode) {
979
- propertyA = propertyA.property;
980
- }
981
- if (propertyB instanceof ObjectTreeNode) {
982
- propertyB = propertyB.property;
983
- }
933
+ if (!propertyA.synthetic && propertyB.synthetic) {
934
+ return 1;
935
+ }
936
+ if (!propertyB.synthetic && propertyA.synthetic) {
937
+ return -1;
938
+ }
939
+ if (!propertyA.isOwn && propertyB.isOwn) {
940
+ return 1;
941
+ }
942
+ if (!propertyB.isOwn && propertyA.isOwn) {
943
+ return -1;
944
+ }
945
+ if (!propertyA.enumerable && propertyB.enumerable) {
946
+ return 1;
947
+ }
948
+ if (!propertyB.enumerable && propertyA.enumerable) {
949
+ return -1;
950
+ }
951
+ if (propertyA.symbol && !propertyB.symbol) {
952
+ return 1;
953
+ }
954
+ if (propertyB.symbol && !propertyA.symbol) {
955
+ return -1;
956
+ }
957
+ if (propertyA.private && !propertyB.private) {
958
+ return 1;
959
+ }
960
+ if (propertyB.private && !propertyA.private) {
961
+ return -1;
962
+ }
984
963
 
985
- if (!propertyA.synthetic && propertyB.synthetic) {
986
- return 1;
987
- }
988
- if (!propertyB.synthetic && propertyA.synthetic) {
989
- return -1;
990
- }
991
- if (!propertyA.isOwn && propertyB.isOwn) {
992
- return 1;
993
- }
994
- if (!propertyB.isOwn && propertyA.isOwn) {
995
- return -1;
996
- }
997
- if (!propertyA.enumerable && propertyB.enumerable) {
998
- return 1;
999
- }
1000
- if (!propertyB.enumerable && propertyA.enumerable) {
1001
- return -1;
1002
- }
1003
- if (propertyA.symbol && !propertyB.symbol) {
1004
- return 1;
1005
- }
1006
- if (propertyB.symbol && !propertyA.symbol) {
1007
- return -1;
1008
- }
1009
- if (propertyA.private && !propertyB.private) {
964
+ if (sortPropertiesAlphabetically) {
965
+ const nameA = propertyA.name;
966
+ const nameB = propertyB.name;
967
+ if (nameA.startsWith('_') && !nameB.startsWith('_')) {
1010
968
  return 1;
1011
969
  }
1012
- if (propertyB.private && !propertyA.private) {
970
+ if (nameB.startsWith('_') && !nameA.startsWith('_')) {
1013
971
  return -1;
1014
972
  }
1015
-
1016
- if (sortPropertiesAlphabetically) {
1017
- const nameA = propertyA.name;
1018
- const nameB = propertyB.name;
1019
- if (nameA.startsWith('_') && !nameB.startsWith('_')) {
1020
- return 1;
1021
- }
1022
- if (nameB.startsWith('_') && !nameA.startsWith('_')) {
1023
- return -1;
1024
- }
1025
- return Platform.StringUtilities.naturalOrderComparator(nameA, nameB);
1026
- }
1027
-
1028
- return 0;
1029
- }
1030
-
1031
- static valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string,
1032
- details?: SDK.DebuggerModel.FunctionDetails|null,
1033
- linkify?: boolean): LitTemplate {
1034
- const contents =
1035
- (description: string, defaultName: string): {prefix: string, abbreviation: string, body: string} => {
1036
- const text = description.replace(/^function [gs]et /, 'function ')
1037
- .replace(/^function [gs]et\(/, 'function\(')
1038
- .replace(/^[gs]et /, '');
1039
-
1040
- // This set of best-effort regular expressions captures common function descriptions.
1041
- // Ideally, some parser would provide prefix, arguments, function body text separately.
1042
- const asyncMatch = text.match(/^(async\s+function)/);
1043
- const isGenerator = text.startsWith('function*');
1044
- const isGeneratorShorthand = text.startsWith('*');
1045
- const isBasic = !isGenerator && text.startsWith('function');
1046
- const isClass = text.startsWith('class ') || text.startsWith('class{');
1047
- const firstArrowIndex = text.indexOf('=>');
1048
- const isArrow = !asyncMatch && !isGenerator && !isBasic && !isClass && firstArrowIndex > 0;
1049
-
1050
- if (isClass) {
1051
- const body = text.substring('class'.length);
1052
- const classNameMatch = /^[^{\s]+/.exec(body.trim());
1053
- let className: string = defaultName;
1054
- if (classNameMatch) {
1055
- className = classNameMatch[0].trim() || defaultName;
1056
- }
1057
- return {prefix: 'class', body, abbreviation: className};
1058
- }
1059
- if (asyncMatch) {
1060
- const body = text.substring(asyncMatch[1].length);
1061
- return {prefix: 'async \u0192', body, abbreviation: nameAndArguments(body)};
1062
- }
1063
- if (isGenerator) {
1064
- const body = text.substring('function*'.length);
1065
- return {prefix: '\u0192*', body, abbreviation: nameAndArguments(body)};
1066
- }
1067
- if (isGeneratorShorthand) {
1068
- const body = text.substring('*'.length);
1069
- return {prefix: '\u0192*', body, abbreviation: nameAndArguments(body)};
1070
- }
1071
- if (isBasic) {
1072
- const body = text.substring('function'.length);
1073
- return {prefix: '\u0192', body, abbreviation: nameAndArguments(body)};
1074
- }
1075
- if (isArrow) {
1076
- const maxArrowFunctionCharacterLength = 60;
1077
- let abbreviation: string = text;
1078
- if (defaultName) {
1079
- abbreviation = defaultName + '()';
1080
- } else if (text.length > maxArrowFunctionCharacterLength) {
1081
- abbreviation = text.substring(0, firstArrowIndex + 2) + ' {…}';
1082
- }
1083
- return {prefix: '', body: text, abbreviation};
1084
- }
1085
- return {prefix: '\u0192', body: text, abbreviation: nameAndArguments(text)};
1086
- };
1087
-
1088
- const {prefix, body, abbreviation} = contents(description ?? '', defaultName ?? '');
1089
- const maxFunctionBodyLength = 200;
1090
-
1091
- const location = details?.location;
1092
- const clickHandler = linkify && location ? (event: Event) => {
1093
- void Common.Revealer.reveal(location);
1094
- event.consume(true);
1095
- } : undefined;
1096
-
1097
- const classes = classMap({
1098
- 'object-value-function': true,
1099
- linkified: Boolean(linkify && location),
1100
- });
1101
- const title = description ? Platform.StringUtilities.trimEndWithMaxLength(description, 500) : undefined;
1102
-
1103
- return html`<span
1104
- class=${classes}
1105
- @click=${clickHandler || nothing}
1106
- title=${ifDefined(title)}>${prefix && html`<span class=object-value-function-prefix>${prefix} </span>`}${
1107
- includePreview ? Platform.StringUtilities.trimEndWithMaxLength(body.trim(), maxFunctionBodyLength) :
1108
- abbreviation.replace(/\n/g, ' ')}</span>`;
1109
-
1110
- function nameAndArguments(contents: string): string {
1111
- const startOfArgumentsIndex = contents.indexOf('(');
1112
- const endOfArgumentsMatch = contents.match(/\)\s*{/);
1113
- if (startOfArgumentsIndex !== -1 && endOfArgumentsMatch?.index !== undefined &&
1114
- endOfArgumentsMatch.index > startOfArgumentsIndex) {
1115
- const name = contents.substring(0, startOfArgumentsIndex).trim() || (defaultName ?? '');
1116
- const args = contents.substring(startOfArgumentsIndex, endOfArgumentsMatch.index + 1);
1117
- return name + args;
1118
- }
1119
- return defaultName + '()';
1120
- }
973
+ return Platform.StringUtilities.naturalOrderComparator(nameA, nameB);
1121
974
  }
1122
975
 
1123
- static getMemoryIcon(object: SDK.RemoteObject.RemoteObject, expression?: string): LitTemplate {
1124
- // Directly set styles on memory icon, so that the memory icon is also
1125
- // styled within the context of code mirror.
1126
- // clang-format off
1127
- return !object.isLinearMemoryInspectable() ? nothing : html`<devtools-icon
1128
- name=memory
1129
- style="width: var(--sys-size-8); height: 13px; vertical-align: sub; cursor: pointer;"
1130
- @click=${(event: Event) => {
1131
- event.consume();
1132
- void Common.Revealer.reveal(new SDK.RemoteObject.LinearMemoryInspectable(object, expression));
1133
- }}
1134
- jslog=${VisualLogging.action('open-memory-inspector').track({click: true})}
1135
- title=${i18nString(UIStrings.openInMemoryInpector)}
1136
- aria-label=${i18nString(UIStrings.openInMemoryInpector)}></devtools-icon>`;
1137
- // clang-format on
1138
- }
1139
-
1140
- static appendMemoryIcon(element: Element, object: SDK.RemoteObject.RemoteObject, expression?: string): void {
1141
- const fragment = document.createDocumentFragment();
1142
- // eslint-disable-next-line @devtools/no-lit-render-outside-of-view
1143
- render(ObjectPropertiesSection.getMemoryIcon(object, expression), fragment);
1144
- element.appendChild(fragment);
1145
- }
976
+ return 0;
977
+ }
1146
978
 
1147
- static isDisplayableProperty(property: SDK.RemoteObject.RemoteObjectProperty,
1148
- parentProperty?: SDK.RemoteObject.RemoteObjectProperty): boolean {
1149
- if (!parentProperty?.synthetic) {
1150
- return true;
979
+ export function valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string,
980
+ details?: SDK.DebuggerModel.FunctionDetails|null,
981
+ linkify?: boolean): LitTemplate {
982
+ const contents = (description: string, defaultName: string): {prefix: string, abbreviation: string, body: string} => {
983
+ const text = description.replace(/^function [gs]et /, 'function ')
984
+ .replace(/^function [gs]et\(/, 'function\(')
985
+ .replace(/^[gs]et /, '');
986
+
987
+ // This set of best-effort regular expressions captures common function descriptions.
988
+ // Ideally, some parser would provide prefix, arguments, function body text separately.
989
+ const asyncMatch = text.match(/^(async\s+function)/);
990
+ const isGenerator = text.startsWith('function*');
991
+ const isGeneratorShorthand = text.startsWith('*');
992
+ const isBasic = !isGenerator && text.startsWith('function');
993
+ const isClass = text.startsWith('class ') || text.startsWith('class{');
994
+ const firstArrowIndex = text.indexOf('=>');
995
+ const isArrow = !asyncMatch && !isGenerator && !isBasic && !isClass && firstArrowIndex > 0;
996
+
997
+ if (isClass) {
998
+ const body = text.substring('class'.length);
999
+ const classNameMatch = /^[^{\s]+/.exec(body.trim());
1000
+ let className: string = defaultName;
1001
+ if (classNameMatch) {
1002
+ className = classNameMatch[0].trim() || defaultName;
1003
+ }
1004
+ return {prefix: 'class', body, abbreviation: className};
1005
+ }
1006
+ if (asyncMatch) {
1007
+ const body = text.substring(asyncMatch[1].length);
1008
+ return {prefix: 'async \u0192', body, abbreviation: nameAndArguments(body)};
1009
+ }
1010
+ if (isGenerator) {
1011
+ const body = text.substring('function*'.length);
1012
+ return {prefix: '\u0192*', body, abbreviation: nameAndArguments(body)};
1013
+ }
1014
+ if (isGeneratorShorthand) {
1015
+ const body = text.substring('*'.length);
1016
+ return {prefix: '\u0192*', body, abbreviation: nameAndArguments(body)};
1017
+ }
1018
+ if (isBasic) {
1019
+ const body = text.substring('function'.length);
1020
+ return {prefix: '\u0192', body, abbreviation: nameAndArguments(body)};
1021
+ }
1022
+ if (isArrow) {
1023
+ const maxArrowFunctionCharacterLength = 60;
1024
+ let abbreviation: string = text;
1025
+ if (defaultName) {
1026
+ abbreviation = defaultName + '()';
1027
+ } else if (text.length > maxArrowFunctionCharacterLength) {
1028
+ abbreviation = text.substring(0, firstArrowIndex + 2) + ' {…}';
1029
+ }
1030
+ return {prefix: '', body: text, abbreviation};
1151
1031
  }
1152
- const name = property.name;
1153
- const useless = (parentProperty.name === '[[Entries]]' && (name === 'length' || name === '__proto__'));
1154
- return !useless;
1155
- }
1032
+ return {prefix: '\u0192', body: text, abbreviation: nameAndArguments(text)};
1033
+ };
1156
1034
 
1157
- skipProto(): void {
1158
- this.skipProtoInternal = true;
1159
- }
1035
+ const {prefix, body, abbreviation} = contents(description ?? '', defaultName ?? '');
1036
+ const maxFunctionBodyLength = 200;
1160
1037
 
1161
- expand(): void {
1162
- this.#objectTreeElement.expand();
1163
- }
1038
+ const location = details?.location;
1039
+ const clickHandler = linkify && location ? (event: Event) => {
1040
+ void Common.Revealer.reveal(location);
1041
+ event.consume(true);
1042
+ } : undefined;
1164
1043
 
1165
- objectTreeElement(): UI.TreeOutline.TreeElement {
1166
- return this.#objectTreeElement;
1167
- }
1044
+ const classes = classMap({
1045
+ 'object-value-function': true,
1046
+ linkified: Boolean(linkify && location),
1047
+ });
1048
+ const title = description ? Platform.StringUtilities.trimEndWithMaxLength(description, 500) : undefined;
1168
1049
 
1169
- enableContextMenu(): void {
1170
- this.element.addEventListener('contextmenu', this.contextMenuEventFired.bind(this), false);
1050
+ return html`<span
1051
+ class=${classes}
1052
+ @click=${clickHandler || nothing}
1053
+ title=${ifDefined(title)}>${prefix && html`<span class=object-value-function-prefix>${prefix} </span>`}${
1054
+ includePreview ? Platform.StringUtilities.trimEndWithMaxLength(body.trim(), maxFunctionBodyLength) :
1055
+ abbreviation.replace(/\n/g, ' ')}</span>`;
1056
+
1057
+ function nameAndArguments(contents: string): string {
1058
+ const startOfArgumentsIndex = contents.indexOf('(');
1059
+ const endOfArgumentsMatch = contents.match(/\)\s*{/);
1060
+ if (startOfArgumentsIndex !== -1 && endOfArgumentsMatch?.index !== undefined &&
1061
+ endOfArgumentsMatch.index > startOfArgumentsIndex) {
1062
+ const name = contents.substring(0, startOfArgumentsIndex).trim() || (defaultName ?? '');
1063
+ const args = contents.substring(startOfArgumentsIndex, endOfArgumentsMatch.index + 1);
1064
+ return name + args;
1065
+ }
1066
+ return defaultName + '()';
1171
1067
  }
1068
+ }
1172
1069
 
1173
- private contextMenuEventFired(event: Event): void {
1174
- const contextMenu = new UI.ContextMenu.ContextMenu(event);
1175
- contextMenu.appendApplicableItems(this.root);
1176
- if (this.root.object instanceof SDK.RemoteObject.LocalJSONObject) {
1177
- contextMenu.viewSection().appendItem(
1178
- i18nString(UIStrings.expandRecursively),
1179
- this.#objectTreeElement.expandRecursively.bind(this.#objectTreeElement, EXPANDABLE_MAX_DEPTH),
1180
- {jslogContext: 'expand-recursively'});
1181
- contextMenu.viewSection().appendItem(i18nString(UIStrings.collapseChildren),
1182
- this.#objectTreeElement.collapseChildren.bind(this.#objectTreeElement),
1183
- {jslogContext: 'collapse-children'});
1184
- }
1185
- void contextMenu.show();
1186
- }
1070
+ export function getMemoryIcon(object: SDK.RemoteObject.RemoteObject, expression?: string): LitTemplate {
1071
+ // Directly set styles on memory icon, so that the memory icon is also
1072
+ // styled within the context of code mirror.
1073
+ // clang-format off
1074
+ return !object.isLinearMemoryInspectable() ? nothing : html`<devtools-icon
1075
+ name=memory
1076
+ style="width: var(--sys-size-8); height: 13px; vertical-align: sub; cursor: pointer;"
1077
+ @click=${(event: Event) => {
1078
+ event.consume();
1079
+ void Common.Revealer.reveal(new SDK.RemoteObject.LinearMemoryInspectable(object, expression));
1080
+ }}
1081
+ jslog=${VisualLogging.action('open-memory-inspector').track({click: true})}
1082
+ title=${i18nString(UIStrings.openInMemoryInpector)}
1083
+ aria-label=${i18nString(UIStrings.openInMemoryInpector)}></devtools-icon>`;
1084
+ // clang-format on
1085
+ }
1187
1086
 
1188
- titleLessMode(): void {
1189
- this.#objectTreeElement.listItemElement.classList.add('hidden');
1190
- this.#objectTreeElement.childrenListElement.classList.add('title-less-mode');
1191
- this.#objectTreeElement.expand();
1087
+ function isDisplayableProperty(property: SDK.RemoteObject.RemoteObjectProperty,
1088
+ parentProperty?: SDK.RemoteObject.RemoteObjectProperty): boolean {
1089
+ if (!parentProperty?.synthetic) {
1090
+ return true;
1192
1091
  }
1092
+ const name = property.name;
1093
+ const useless = (parentProperty.name === '[[Entries]]' && (name === 'length' || name === '__proto__'));
1094
+ return !useless;
1193
1095
  }
1194
1096
 
1195
1097
  export class ObjectPropertiesSectionWidget extends UI.Widget.Widget {
@@ -1611,74 +1513,6 @@ export const OBJECT_PROPERTIES_SECTION_DEFAULT_VIEW: ObjectPropertiesSectionView
1611
1513
  target);
1612
1514
  };
1613
1515
 
1614
- class RootElement extends UI.TreeOutline.TreeElement {
1615
- private readonly object: ObjectTree;
1616
- private readonly linkifier: Components.Linkifier.Linkifier|undefined;
1617
- private readonly emptyPlaceholder: string|null|undefined;
1618
- override toggleOnClick: boolean;
1619
- constructor(object: ObjectTree, linkifier?: Components.Linkifier.Linkifier, emptyPlaceholder?: string|null) {
1620
- const contentElement = document.createElement('slot');
1621
- super(contentElement);
1622
-
1623
- this.object = object;
1624
- this.object.addEventListener(ObjectTreeNodeBase.Events.CHILDREN_CHANGED, this.onpopulate, this);
1625
- this.linkifier = linkifier;
1626
- this.emptyPlaceholder = emptyPlaceholder;
1627
-
1628
- this.setExpandable(true);
1629
- this.selectable = true;
1630
- this.toggleOnClick = true;
1631
- this.listItemElement.classList.add('object-properties-section-root-element');
1632
- this.listItemElement.addEventListener('contextmenu', this.onContextMenu.bind(this), false);
1633
- if (object.expanded) {
1634
- this.expand();
1635
- }
1636
- }
1637
-
1638
- override onexpand(): void {
1639
- this.object.expanded = true;
1640
- if (this.treeOutline) {
1641
- this.treeOutline.element.classList.add('expanded');
1642
- }
1643
- }
1644
-
1645
- override oncollapse(): void {
1646
- this.object.expanded = false;
1647
- if (this.treeOutline) {
1648
- this.treeOutline.element.classList.remove('expanded');
1649
- }
1650
- }
1651
-
1652
- override ondblclick(_e: Event): boolean {
1653
- return true;
1654
- }
1655
-
1656
- private onContextMenu(event: Event): void {
1657
- const contextMenu = new UI.ContextMenu.ContextMenu(event);
1658
- populateObjectTreeContextMenu(
1659
- contextMenu,
1660
- this.object,
1661
- this.expandRecursively.bind(this, EXPANDABLE_MAX_DEPTH),
1662
- this.collapseChildren.bind(this),
1663
- () => {
1664
- this.object.sortPropertiesAlphabetically = !this.object.sortPropertiesAlphabetically;
1665
- },
1666
- () => {
1667
- this.object.includeNullOrUndefinedValues = !this.object.includeNullOrUndefinedValues;
1668
- },
1669
- );
1670
- void contextMenu.show();
1671
- }
1672
-
1673
- override async onpopulate(): Promise<void> {
1674
- this.removeChildren();
1675
- const treeOutline = (this.treeOutline as ObjectPropertiesSection | null);
1676
- const skipProto = treeOutline ? Boolean(treeOutline.skipProtoInternal) : false;
1677
- return await ObjectPropertyTreeElement.populate(this, this.object, skipProto, false, this.linkifier,
1678
- this.emptyPlaceholder);
1679
- }
1680
- }
1681
-
1682
1516
  export function renderPropertyName(name: string|null, isPrivate?: boolean, title?: string): TemplateResult {
1683
1517
  if (name === null) {
1684
1518
  return html`<span class="name" title=${ifDefined(title)}></span>`;
@@ -1701,8 +1535,7 @@ export async function formatObjectAsFunction(func: SDK.RemoteObject.RemoteObject
1701
1535
  // The includePreview flag is false for formats such as console.dir().
1702
1536
  const defaultName = details?.functionName ?? (includePreview ? '' : 'anonymous');
1703
1537
 
1704
- return ObjectPropertiesSection.valueElementForFunctionDescription(func.description, includePreview, defaultName,
1705
- details, linkify);
1538
+ return valueElementForFunctionDescription(func.description, includePreview, defaultName, details, linkify);
1706
1539
  }
1707
1540
 
1708
1541
  export function renderPropertyValue(value: SDK.RemoteObject.RemoteObject, wasThrown: boolean, showPreview: boolean,
@@ -1770,7 +1603,7 @@ export function renderPropertyValue(value: SDK.RemoteObject.RemoteObject, wasThr
1770
1603
  title = tooLong ? undefined : text;
1771
1604
  content = tooLong ? widget(ExpandableTextPropertyValue, {text}) : renderTrustedType(description, className);
1772
1605
  } else if (isFunction) {
1773
- content = ObjectPropertiesSection.valueElementForFunctionDescription(description);
1606
+ content = valueElementForFunctionDescription(description);
1774
1607
  } else if (description.length > maxRenderableStringLength) {
1775
1608
  title = description;
1776
1609
  content = widget(ExpandableTextPropertyValue, {text: description});
@@ -1780,8 +1613,7 @@ export function renderPropertyValue(value: SDK.RemoteObject.RemoteObject, wasThr
1780
1613
  const previewContent = hasPreview ?
1781
1614
  new RemoteObjectPreviewFormatter().renderObjectPreview(value.preview, includeNullOrUndefined) :
1782
1615
  description;
1783
- content = html`${previewContent}${
1784
- isSyntheticProperty ? nothing : ObjectPropertiesSection.getMemoryIcon(value, variableName)}`;
1616
+ content = html`${previewContent}${isSyntheticProperty ? nothing : getMemoryIcon(value, variableName)}`;
1785
1617
  }
1786
1618
 
1787
1619
  if (wasThrown) {
@@ -1951,7 +1783,7 @@ export const OBJECT_PROPERTY_DEFAULT_VIEW: ObjectPropertyView = (input, output,
1951
1783
  Platform.StringUtilities.trimMiddle(property.value.description ?? '',
1952
1784
  maxRenderableStringLength)}${
1953
1785
  property.synthetic ? nothing :
1954
- ObjectPropertiesSection.getMemoryIcon(property.value)}</span>` :
1786
+ getMemoryIcon(property.value)}</span>` :
1955
1787
  value()
1956
1788
  }</devtools-highlight>
1957
1789
  <datalist id=${completionsId}>${repeat(input.completions, c => html`<option>${c}</option>`)}</datalist>
@@ -2184,7 +2016,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
2184
2016
  for (const childNode of ObjectPropertyTreeElement.createNodes(
2185
2017
  value, skipProto, skipGettersAndSetters, linkifier, emptyPlaceholder,
2186
2018
  property => treeElement instanceof ObjectPropertyTreeElement &&
2187
- !ObjectPropertiesSection.isDisplayableProperty(property, treeElement.property?.property))) {
2019
+ !isDisplayableProperty(property, treeElement.property?.property))) {
2188
2020
  treeElement.appendChild(childNode);
2189
2021
  }
2190
2022
  }
@@ -2224,7 +2056,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
2224
2056
  empty = false;
2225
2057
  }
2226
2058
  const sortPropertiesAlphabetically = properties?.[0]?.parent?.sortPropertiesAlphabetically ?? true;
2227
- properties?.sort((a, b) => ObjectPropertiesSection.compareProperties(a, b, sortPropertiesAlphabetically));
2059
+ properties?.sort((a, b) => compareProperties(a, b, sortPropertiesAlphabetically));
2228
2060
 
2229
2061
  const entriesProperty = internalProperties?.find(({property}) => property.name === '[[Entries]]');
2230
2062
  if (entriesProperty) {
@@ -2285,7 +2117,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
2285
2117
  for (const childNode of this.createPropertyNodes(
2286
2118
  children, skipProto, skipGettersAndSetters, linkifier, emptyPlaceholder,
2287
2119
  property => treeNode instanceof ObjectPropertyTreeElement &&
2288
- !ObjectPropertiesSection.isDisplayableProperty(property, treeNode.property?.property))) {
2120
+ !isDisplayableProperty(property, treeNode.property?.property))) {
2289
2121
  treeNode.appendChild(childNode);
2290
2122
  }
2291
2123
  }
@@ -2344,12 +2176,10 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
2344
2176
  }
2345
2177
 
2346
2178
  override async onpopulate(): Promise<void> {
2347
- const treeOutline = (this.treeOutline as ObjectPropertiesSection | null);
2348
- const skipProto = treeOutline ? Boolean(treeOutline.skipProtoInternal) : false;
2349
2179
  this.removeChildren();
2350
2180
 
2351
2181
  if (this.property.object) {
2352
- await ObjectPropertyTreeElement.populate(this, this.property, skipProto, false, this.linkifier);
2182
+ await ObjectPropertyTreeElement.populate(this, this.property, false, false, this.linkifier);
2353
2183
  if (this.childCount() > this.maxNumPropertiesToShow) {
2354
2184
  this.createShowAllPropertiesButton();
2355
2185
  }