chrome-devtools-frontend 1.0.1538310 → 1.0.1539728
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint.config.mjs +1 -1
- package/front_end/core/protocol_client/CDPConnection.ts +12 -10
- package/front_end/core/protocol_client/InspectorBackend.ts +74 -101
- package/front_end/core/protocol_client/NodeURL.ts +1 -3
- package/front_end/core/sdk/ChildTargetManager.ts +5 -41
- package/front_end/core/sdk/Connections.ts +9 -58
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/entrypoints/lighthouse_worker/LighthouseWorkerService.ts +15 -26
- package/front_end/entrypoints/node_app/{NodeConnectionsPanel.ts → app/NodeConnectionsPanel.ts} +8 -8
- package/front_end/entrypoints/node_app/{NodeMain.ts → app/NodeMain.ts} +11 -11
- package/front_end/entrypoints/node_app/app/app.ts +6 -0
- package/front_end/entrypoints/node_app/node_app.ts +4 -2
- package/front_end/generated/{InspectorBackendCommands.js → InspectorBackendCommands.ts} +16 -34
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +18 -3
- package/front_end/models/trace/types/TraceEvents.ts +19 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +49 -26
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -134
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +170 -0
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/chatView.css +0 -31
- package/front_end/panels/ai_assistance/components/disabledWidget.css +45 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/components/FrameDetailsView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +123 -95
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/NodeStackTraceWidget.ts +8 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +0 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +57 -33
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +12 -5
- package/front_end/panels/network/RequestInitiatorView.ts +1 -1
- package/front_end/panels/network/components/EditableSpan.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/recorder/models/RecordingPlayer.ts +8 -7
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -4
- package/front_end/panels/timeline/TimelineFlameChartView.ts +10 -10
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +21 -24
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +3 -2
- package/front_end/panels/utils/utils.ts +4 -2
- package/front_end/services/puppeteer/PuppeteerConnection.ts +56 -53
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +26 -9
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +37 -18
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +26 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js +11 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +10 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +8 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +34 -10
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +8 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +2 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +15 -1
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +7 -5
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +22 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/switch/Switch.docs.ts +38 -0
- package/front_end/ui/components/tooltips/Tooltip.ts +69 -45
- package/front_end/ui/legacy/Slider.docs.ts +49 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +77 -5
- package/front_end/ui/legacy/components/utils/Linkifier.ts +62 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/templates/version.ts.tmpl +0 -4
- package/front_end/ui/components/docs/color_swatch/basic.html +0 -32
- package/front_end/ui/components/docs/color_swatch/basic.ts +0 -38
- package/front_end/ui/components/docs/color_swatch/change-color.html +0 -24
- package/front_end/ui/components/docs/color_swatch/change-color.ts +0 -28
- package/front_end/ui/components/docs/computed_style_property/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/basic.ts +0 -19
- package/front_end/ui/components/docs/computed_style_property/traceable.html +0 -25
- package/front_end/ui/components/docs/computed_style_property/traceable.ts +0 -16
- package/front_end/ui/components/docs/computed_style_trace/basic.html +0 -25
- package/front_end/ui/components/docs/computed_style_trace/basic.ts +0 -24
- package/front_end/ui/components/docs/console_insight/basic.html +0 -28
- package/front_end/ui/components/docs/console_insight/basic.ts +0 -103
- package/front_end/ui/components/docs/console_insight/error.html +0 -28
- package/front_end/ui/components/docs/console_insight/error.ts +0 -33
- package/front_end/ui/components/docs/console_insight/loading.html +0 -28
- package/front_end/ui/components/docs/console_insight/loading.ts +0 -47
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.html +0 -43
- package/front_end/ui/components/docs/elements_breadcrumbs/basic.ts +0 -54
- package/front_end/ui/components/docs/elements_breadcrumbs/helpers.ts +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.html +0 -38
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll-to-active-element.ts +0 -90
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.html +0 -29
- package/front_end/ui/components/docs/elements_breadcrumbs/scroll.ts +0 -62
- package/front_end/ui/components/docs/icon_button/basic.html +0 -34
- package/front_end/ui/components/docs/icon_button/basic.ts +0 -67
- package/front_end/ui/components/docs/issue_counter/basic.html +0 -35
- package/front_end/ui/components/docs/issue_counter/basic.ts +0 -34
- package/front_end/ui/components/docs/issue_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/issue_link_icon/basic.ts +0 -26
- package/front_end/ui/components/docs/linear_memory_inspector/basic.html +0 -26
- package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +0 -44
- package/front_end/ui/components/docs/menu/basic.html +0 -28
- package/front_end/ui/components/docs/menu/basic.ts +0 -66
- package/front_end/ui/components/docs/recorder_control_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_control_button/basic.ts +0 -15
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_recording_list_view/basic.ts +0 -26
- package/front_end/ui/components/docs/recorder_select_button/basic.html +0 -20
- package/front_end/ui/components/docs/recorder_select_button/basic.ts +0 -81
- package/front_end/ui/components/docs/recorder_split_view/basic.html +0 -17
- package/front_end/ui/components/docs/recorder_split_view/basic.ts +0 -22
- package/front_end/ui/components/docs/request_link_icon/basic.html +0 -31
- package/front_end/ui/components/docs/request_link_icon/basic.ts +0 -21
- package/front_end/ui/components/docs/slider/basic.ts +0 -62
- package/front_end/ui/components/docs/style_property_editor/flex.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/flex.ts +0 -52
- package/front_end/ui/components/docs/style_property_editor/grid.html +0 -22
- package/front_end/ui/components/docs/style_property_editor/grid.ts +0 -50
- package/front_end/ui/components/docs/style_property_editor/masonry.html +0 -21
- package/front_end/ui/components/docs/style_property_editor/masonry.ts +0 -50
- package/front_end/ui/components/docs/switch/basic.ts +0 -51
- /package/front_end/entrypoints/node_app/{nodeConnectionsPanel.css → app/nodeConnectionsPanel.css} +0 -0
|
@@ -30,6 +30,10 @@ import {TimeoutError} from '../common/Errors.js';
|
|
|
30
30
|
import type {SupportedBrowser} from '../common/SupportedBrowser.js';
|
|
31
31
|
import {debugError, DEFAULT_VIEWPORT} from '../common/util.js';
|
|
32
32
|
import type {Viewport} from '../common/Viewport.js';
|
|
33
|
+
import {
|
|
34
|
+
createIncrementalIdGenerator,
|
|
35
|
+
type GetIdFn,
|
|
36
|
+
} from '../util/incremental-id-generator.js';
|
|
33
37
|
|
|
34
38
|
import type {ChromeReleaseChannel, LaunchOptions} from './LaunchOptions.js';
|
|
35
39
|
import {NodeWebSocketTransport as WebSocketTransport} from './NodeWebSocketTransport.js';
|
|
@@ -88,6 +92,7 @@ export abstract class BrowserLauncher {
|
|
|
88
92
|
waitForInitialPage = true,
|
|
89
93
|
protocolTimeout,
|
|
90
94
|
handleDevToolsAsPage,
|
|
95
|
+
idGenerator = createIncrementalIdGenerator(),
|
|
91
96
|
} = options;
|
|
92
97
|
|
|
93
98
|
let {protocol} = options;
|
|
@@ -166,6 +171,7 @@ export abstract class BrowserLauncher {
|
|
|
166
171
|
defaultViewport,
|
|
167
172
|
acceptInsecureCerts,
|
|
168
173
|
networkEnabled,
|
|
174
|
+
idGenerator,
|
|
169
175
|
},
|
|
170
176
|
);
|
|
171
177
|
} else {
|
|
@@ -174,12 +180,14 @@ export abstract class BrowserLauncher {
|
|
|
174
180
|
timeout,
|
|
175
181
|
protocolTimeout,
|
|
176
182
|
slowMo,
|
|
183
|
+
idGenerator,
|
|
177
184
|
});
|
|
178
185
|
} else {
|
|
179
186
|
cdpConnection = await this.createCdpSocketConnection(browserProcess, {
|
|
180
187
|
timeout,
|
|
181
188
|
protocolTimeout,
|
|
182
189
|
slowMo,
|
|
190
|
+
idGenerator,
|
|
183
191
|
});
|
|
184
192
|
}
|
|
185
193
|
|
|
@@ -342,6 +350,7 @@ export abstract class BrowserLauncher {
|
|
|
342
350
|
timeout: number;
|
|
343
351
|
protocolTimeout: number | undefined;
|
|
344
352
|
slowMo: number;
|
|
353
|
+
idGenerator: GetIdFn;
|
|
345
354
|
},
|
|
346
355
|
): Promise<Connection> {
|
|
347
356
|
const browserWSEndpoint = await browserProcess.waitForLineOutput(
|
|
@@ -354,6 +363,8 @@ export abstract class BrowserLauncher {
|
|
|
354
363
|
transport,
|
|
355
364
|
opts.slowMo,
|
|
356
365
|
opts.protocolTimeout,
|
|
366
|
+
/* rawErrors */ false,
|
|
367
|
+
opts.idGenerator,
|
|
357
368
|
);
|
|
358
369
|
}
|
|
359
370
|
|
|
@@ -366,6 +377,7 @@ export abstract class BrowserLauncher {
|
|
|
366
377
|
timeout: number;
|
|
367
378
|
protocolTimeout: number | undefined;
|
|
368
379
|
slowMo: number;
|
|
380
|
+
idGenerator: GetIdFn;
|
|
369
381
|
},
|
|
370
382
|
): Promise<Connection> {
|
|
371
383
|
// stdio was assigned during start(), and the 'pipe' option there adds the
|
|
@@ -375,7 +387,14 @@ export abstract class BrowserLauncher {
|
|
|
375
387
|
pipeWrite as NodeJS.WritableStream,
|
|
376
388
|
pipeRead as NodeJS.ReadableStream,
|
|
377
389
|
);
|
|
378
|
-
return new Connection(
|
|
390
|
+
return new Connection(
|
|
391
|
+
'',
|
|
392
|
+
transport,
|
|
393
|
+
opts.slowMo,
|
|
394
|
+
opts.protocolTimeout,
|
|
395
|
+
/* rawErrors */ false,
|
|
396
|
+
opts.idGenerator,
|
|
397
|
+
);
|
|
379
398
|
}
|
|
380
399
|
|
|
381
400
|
/**
|
|
@@ -417,6 +436,7 @@ export abstract class BrowserLauncher {
|
|
|
417
436
|
timeout: number;
|
|
418
437
|
protocolTimeout: number | undefined;
|
|
419
438
|
slowMo: number;
|
|
439
|
+
idGenerator: GetIdFn;
|
|
420
440
|
defaultViewport: Viewport | null;
|
|
421
441
|
acceptInsecureCerts?: boolean;
|
|
422
442
|
networkEnabled?: boolean;
|
|
@@ -432,6 +452,7 @@ export abstract class BrowserLauncher {
|
|
|
432
452
|
const bidiConnection = new BiDi.BidiConnection(
|
|
433
453
|
browserWSEndpoint,
|
|
434
454
|
transport,
|
|
455
|
+
opts.idGenerator,
|
|
435
456
|
opts.slowMo,
|
|
436
457
|
opts.protocolTimeout,
|
|
437
458
|
);
|
|
@@ -69,7 +69,7 @@ export class PreviewToggle extends HTMLElement {
|
|
|
69
69
|
<devtools-checkbox
|
|
70
70
|
?checked=${checked}
|
|
71
71
|
@change=${this.#checkboxChanged}
|
|
72
|
-
aria-label=${this.#name}
|
|
72
|
+
aria-label=${this.#name} >
|
|
73
73
|
<devtools-icon name="experiment" class="medium">
|
|
74
74
|
</devtools-icon>${this.#name}
|
|
75
75
|
</devtools-checkbox>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import {Switch} from './switch.js';
|
|
6
|
+
|
|
7
|
+
export async function render(container: HTMLElement) {
|
|
8
|
+
function switchExample({checked, disabled}: {checked: boolean, disabled: boolean}): HTMLElement {
|
|
9
|
+
const example = document.createElement('div');
|
|
10
|
+
example.style.marginTop = '20px';
|
|
11
|
+
const explanation = document.createElement('div');
|
|
12
|
+
const disabledExplanation = document.createElement('div');
|
|
13
|
+
const component = new Switch.Switch();
|
|
14
|
+
component.checked = checked;
|
|
15
|
+
component.disabled = disabled;
|
|
16
|
+
explanation.textContent = `is checked? ${component.checked}`;
|
|
17
|
+
disabledExplanation.textContent = `is disabled? ${component.disabled}`;
|
|
18
|
+
component.addEventListener(Switch.SwitchChangeEvent.eventName, ev => {
|
|
19
|
+
explanation.textContent = `is checked? ${ev.checked}`;
|
|
20
|
+
});
|
|
21
|
+
example.appendChild(component);
|
|
22
|
+
example.appendChild(explanation);
|
|
23
|
+
example.appendChild(disabledExplanation);
|
|
24
|
+
return example;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Basic
|
|
28
|
+
container.appendChild(switchExample({checked: false, disabled: false}));
|
|
29
|
+
|
|
30
|
+
// Already checked
|
|
31
|
+
container.appendChild(switchExample({checked: true, disabled: false}));
|
|
32
|
+
|
|
33
|
+
// Disabled
|
|
34
|
+
container.appendChild(switchExample({checked: false, disabled: true}));
|
|
35
|
+
|
|
36
|
+
// Disabled & checked
|
|
37
|
+
container.appendChild(switchExample({checked: true, disabled: true}));
|
|
38
|
+
}
|
|
@@ -21,7 +21,7 @@ interface PositioningParams {
|
|
|
21
21
|
currentPopoverRect: DOMRect;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
enum PositionOption {
|
|
24
|
+
export enum PositionOption {
|
|
25
25
|
BOTTOM_SPAN_RIGHT = 'bottom-span-right',
|
|
26
26
|
BOTTOM_SPAN_LEFT = 'bottom-span-left',
|
|
27
27
|
TOP_SPAN_RIGHT = 'top-span-right',
|
|
@@ -66,29 +66,32 @@ const positioningUtils = {
|
|
|
66
66
|
};
|
|
67
67
|
},
|
|
68
68
|
// Adjusts proposed rect so that the resulting popover is always inside the inspector view bounds.
|
|
69
|
-
insetAdjustedRect:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
insetAdjustedRect: ({inspectorViewRect, currentPopoverRect, proposedRect}:
|
|
70
|
+
{inspectorViewRect: DOMRect, currentPopoverRect: DOMRect, proposedRect: ProposedRect}):
|
|
71
|
+
ProposedRect => {
|
|
72
|
+
if (inspectorViewRect.left > proposedRect.left) {
|
|
73
|
+
proposedRect.left = inspectorViewRect.left;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (inspectorViewRect.right < proposedRect.left + currentPopoverRect.width) {
|
|
77
|
+
proposedRect.left = inspectorViewRect.right - currentPopoverRect.width;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (proposedRect.top < inspectorViewRect.top) {
|
|
81
|
+
proposedRect.top = inspectorViewRect.top;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (proposedRect.top + currentPopoverRect.height > inspectorViewRect.bottom) {
|
|
85
|
+
proposedRect.top = inspectorViewRect.bottom - currentPopoverRect.height;
|
|
86
|
+
}
|
|
87
|
+
return proposedRect;
|
|
88
|
+
},
|
|
86
89
|
isInBounds: ({inspectorViewRect, currentPopoverRect, proposedRect}:
|
|
87
90
|
{inspectorViewRect: DOMRect, currentPopoverRect: DOMRect, proposedRect: ProposedRect}): boolean => {
|
|
88
|
-
return inspectorViewRect.left
|
|
89
|
-
proposedRect.left + currentPopoverRect.width
|
|
90
|
-
inspectorViewRect.top
|
|
91
|
-
proposedRect.top + currentPopoverRect.height
|
|
91
|
+
return inspectorViewRect.left <= proposedRect.left &&
|
|
92
|
+
proposedRect.left + currentPopoverRect.width <= inspectorViewRect.right &&
|
|
93
|
+
inspectorViewRect.top <= proposedRect.top &&
|
|
94
|
+
proposedRect.top + currentPopoverRect.height <= inspectorViewRect.bottom;
|
|
92
95
|
},
|
|
93
96
|
isSameRect: (rect1: DOMRect|null, rect2: DOMRect|null): boolean => {
|
|
94
97
|
if (!rect1 || !rect2) {
|
|
@@ -100,7 +103,7 @@ const positioningUtils = {
|
|
|
100
103
|
}
|
|
101
104
|
};
|
|
102
105
|
|
|
103
|
-
const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopoverRect, preferredPositions}: {
|
|
106
|
+
export const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopoverRect, preferredPositions}: {
|
|
104
107
|
inspectorViewRect: DOMRect,
|
|
105
108
|
anchorRect: DOMRect,
|
|
106
109
|
currentPopoverRect: DOMRect,
|
|
@@ -116,36 +119,49 @@ const proposedRectForRichTooltip = ({inspectorViewRect, anchorRect, currentPopov
|
|
|
116
119
|
]),
|
|
117
120
|
];
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
// If none of them work out, we default to showing the tooltip in the bottom right and adjust
|
|
121
|
-
// its insets so that the tooltip is inside the inspector view bounds.
|
|
122
|
-
for (const positionOption of uniqueOrder) {
|
|
123
|
-
let proposedRect;
|
|
122
|
+
const getProposedRectForPositionOption = (positionOption: PositionOption): ProposedRect => {
|
|
124
123
|
switch (positionOption) {
|
|
125
124
|
case PositionOption.BOTTOM_SPAN_RIGHT:
|
|
126
|
-
|
|
127
|
-
break;
|
|
125
|
+
return positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
|
|
128
126
|
case PositionOption.BOTTOM_SPAN_LEFT:
|
|
129
|
-
|
|
130
|
-
break;
|
|
127
|
+
return positioningUtils.bottomSpanLeft({anchorRect, currentPopoverRect});
|
|
131
128
|
case PositionOption.TOP_SPAN_RIGHT:
|
|
132
|
-
|
|
133
|
-
break;
|
|
129
|
+
return positioningUtils.topSpanRight({anchorRect, currentPopoverRect});
|
|
134
130
|
case PositionOption.TOP_SPAN_LEFT:
|
|
135
|
-
|
|
131
|
+
return positioningUtils.topSpanLeft({anchorRect, currentPopoverRect});
|
|
136
132
|
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Tries the positioning options in the order given by `uniqueOrder`.
|
|
136
|
+
for (const positionOption of uniqueOrder) {
|
|
137
|
+
const proposedRect = getProposedRectForPositionOption(positionOption);
|
|
137
138
|
if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
|
|
138
139
|
return proposedRect;
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
|
|
142
|
-
// If none of the options work
|
|
143
|
-
//
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
// If none of the options above work, we decide between top or bottom by which
|
|
144
|
+
// option is fewer vertical pixels out of the viewport. We pick left/right
|
|
145
|
+
// according to `uniqueOrder`. And finally we adjust the insets so that the
|
|
146
|
+
// tooltip is not out of bounds.
|
|
147
|
+
const bottomProposed = positioningUtils.bottomSpanRight({anchorRect, currentPopoverRect});
|
|
148
|
+
const bottomVerticalOutOfBounds =
|
|
149
|
+
Math.max(0, bottomProposed.top + currentPopoverRect.height - inspectorViewRect.bottom);
|
|
150
|
+
const topProposed = positioningUtils.topSpanRight({anchorRect, currentPopoverRect});
|
|
151
|
+
const topVerticalOutOfBounds = Math.max(0, inspectorViewRect.top - topProposed.top);
|
|
152
|
+
const prefersBottom = bottomVerticalOutOfBounds <= topVerticalOutOfBounds;
|
|
153
|
+
const fallbackOption = uniqueOrder.find(option => {
|
|
154
|
+
if (prefersBottom) {
|
|
155
|
+
return option === PositionOption.BOTTOM_SPAN_LEFT || option === PositionOption.BOTTOM_SPAN_RIGHT;
|
|
156
|
+
}
|
|
157
|
+
return option === PositionOption.TOP_SPAN_LEFT || option === PositionOption.TOP_SPAN_RIGHT;
|
|
158
|
+
}) ??
|
|
159
|
+
PositionOption.TOP_SPAN_RIGHT;
|
|
160
|
+
const fallbackRect = getProposedRectForPositionOption(fallbackOption);
|
|
161
|
+
return positioningUtils.insetAdjustedRect({currentPopoverRect, inspectorViewRect, proposedRect: fallbackRect});
|
|
146
162
|
};
|
|
147
163
|
|
|
148
|
-
const proposedRectForSimpleTooltip =
|
|
164
|
+
export const proposedRectForSimpleTooltip =
|
|
149
165
|
({inspectorViewRect, anchorRect, currentPopoverRect}:
|
|
150
166
|
{inspectorViewRect: DOMRect, anchorRect: DOMRect, currentPopoverRect: DOMRect}): ProposedRect => {
|
|
151
167
|
// Default options are bottom centered & top centered.
|
|
@@ -153,16 +169,24 @@ const proposedRectForSimpleTooltip =
|
|
|
153
169
|
if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
|
|
154
170
|
return proposedRect;
|
|
155
171
|
}
|
|
172
|
+
const bottomVerticalOutOfBoundsAmount =
|
|
173
|
+
Math.max(0, proposedRect.top + currentPopoverRect.height - inspectorViewRect.bottom);
|
|
156
174
|
|
|
157
175
|
proposedRect = positioningUtils.topCentered({anchorRect, currentPopoverRect});
|
|
158
176
|
if (positioningUtils.isInBounds({inspectorViewRect, currentPopoverRect, proposedRect})) {
|
|
159
177
|
return proposedRect;
|
|
160
178
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
|
|
179
|
+
const topVerticalOutOfBoundsAmount = Math.max(0, inspectorViewRect.top - proposedRect.top);
|
|
180
|
+
|
|
181
|
+
// The default options did not work out, so compare which option is fewer
|
|
182
|
+
// pixels out of the viewport vertically. Pick the better option and
|
|
183
|
+
// adjust the insets to make sure that the tooltip is not out of bounds.
|
|
184
|
+
if (bottomVerticalOutOfBoundsAmount <= topVerticalOutOfBoundsAmount) {
|
|
185
|
+
proposedRect = positioningUtils.bottomCentered({anchorRect, currentPopoverRect});
|
|
186
|
+
} else {
|
|
187
|
+
proposedRect = positioningUtils.topCentered({anchorRect, currentPopoverRect});
|
|
188
|
+
}
|
|
189
|
+
return positioningUtils.insetAdjustedRect({currentPopoverRect, inspectorViewRect, proposedRect});
|
|
166
190
|
};
|
|
167
191
|
|
|
168
192
|
export type TooltipVariant = 'simple'|'rich';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright 2024 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import {UIUtils} from './legacy.js';
|
|
6
|
+
|
|
7
|
+
export async function render(container: HTMLElement) {
|
|
8
|
+
function sliderExample({min, max, tabIndex, disabled}: {
|
|
9
|
+
min: number,
|
|
10
|
+
max: number,
|
|
11
|
+
tabIndex: number,
|
|
12
|
+
disabled: boolean,
|
|
13
|
+
}): HTMLElement {
|
|
14
|
+
const example = document.createElement('div');
|
|
15
|
+
example.style.marginTop = '20px';
|
|
16
|
+
const minExplanation = document.createElement('div');
|
|
17
|
+
const maxExplanation = document.createElement('div');
|
|
18
|
+
const valueExplanation = document.createElement('div');
|
|
19
|
+
const disabledExplanation = document.createElement('div');
|
|
20
|
+
const tabbableExplanation = document.createElement('div');
|
|
21
|
+
const component = UIUtils.createSlider(min, max, tabIndex);
|
|
22
|
+
component.disabled = disabled;
|
|
23
|
+
minExplanation.textContent = `min: ${min}`;
|
|
24
|
+
maxExplanation.textContent = `max: ${max}`;
|
|
25
|
+
valueExplanation.textContent = `value: ${component.value}`;
|
|
26
|
+
disabledExplanation.textContent = `is disabled? ${component.disabled}`;
|
|
27
|
+
tabbableExplanation.textContent = `is tabbable? ${component.tabIndex >= 0}`;
|
|
28
|
+
|
|
29
|
+
component.addEventListener('change', () => {
|
|
30
|
+
valueExplanation.textContent = `value: ${component.value}`;
|
|
31
|
+
});
|
|
32
|
+
example.appendChild(component);
|
|
33
|
+
example.appendChild(minExplanation);
|
|
34
|
+
example.appendChild(maxExplanation);
|
|
35
|
+
example.appendChild(valueExplanation);
|
|
36
|
+
example.appendChild(disabledExplanation);
|
|
37
|
+
example.appendChild(tabbableExplanation);
|
|
38
|
+
return example;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Basic
|
|
42
|
+
container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: false}));
|
|
43
|
+
|
|
44
|
+
// Not tab reachable
|
|
45
|
+
container.appendChild(sliderExample({min: 0, max: 100, tabIndex: -1, disabled: false}));
|
|
46
|
+
|
|
47
|
+
// Disabled
|
|
48
|
+
container.appendChild(sliderExample({min: 0, max: 100, tabIndex: 0, disabled: true}));
|
|
49
|
+
}
|
|
@@ -39,6 +39,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
39
39
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
40
40
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
41
41
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
42
|
+
import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
|
|
42
43
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
43
44
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
44
45
|
import * as UI from '../../legacy.js';
|
|
@@ -95,7 +96,8 @@ function populateContextMenu(link: Element, event: Event): void {
|
|
|
95
96
|
void contextMenu.show();
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
// TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
|
|
100
|
+
export function buildStackTraceRowsForLegacyRuntimeStackTrace(
|
|
99
101
|
stackTrace: Protocol.Runtime.StackTrace,
|
|
100
102
|
target: SDK.Target.Target|null,
|
|
101
103
|
linkifier: Linkifier,
|
|
@@ -158,6 +160,63 @@ export function buildStackTraceRows(
|
|
|
158
160
|
return stackTraceRows;
|
|
159
161
|
}
|
|
160
162
|
|
|
163
|
+
export function buildStackTraceRows(
|
|
164
|
+
stackTrace: StackTrace.StackTrace.StackTrace,
|
|
165
|
+
target: SDK.Target.Target|null,
|
|
166
|
+
linkifier: Linkifier,
|
|
167
|
+
tabStops: boolean|undefined,
|
|
168
|
+
showColumnNumber?: boolean,
|
|
169
|
+
): Array<StackTraceRegularRow|StackTraceAsyncRow> {
|
|
170
|
+
const stackTraceRows: Array<StackTraceRegularRow|StackTraceAsyncRow> = [];
|
|
171
|
+
|
|
172
|
+
function buildStackTraceRowsHelper(
|
|
173
|
+
fragment: StackTrace.StackTrace.Fragment|StackTrace.StackTrace.AsyncFragment,
|
|
174
|
+
previousFragment: StackTrace.StackTrace.Fragment|undefined = undefined): void {
|
|
175
|
+
let asyncRow: StackTraceAsyncRow|null = null;
|
|
176
|
+
const isAsync = 'description' in fragment;
|
|
177
|
+
if (previousFragment && isAsync) {
|
|
178
|
+
asyncRow = {
|
|
179
|
+
asyncDescription: UI.UIUtils.asyncStackTraceLabel(
|
|
180
|
+
fragment.description, previousFragment.frames.map(f => ({functionName: f.name ?? ''}))),
|
|
181
|
+
};
|
|
182
|
+
stackTraceRows.push(asyncRow);
|
|
183
|
+
}
|
|
184
|
+
let previousStackFrameWasBreakpointCondition = false;
|
|
185
|
+
for (const frame of fragment.frames) {
|
|
186
|
+
const functionName = UI.UIUtils.beautifyFunctionName(frame.name ?? '');
|
|
187
|
+
const link = linkifier.maybeLinkifyStackTraceFrame(target, frame, {
|
|
188
|
+
showColumnNumber,
|
|
189
|
+
tabStop: Boolean(tabStops),
|
|
190
|
+
inlineFrameIndex: 0,
|
|
191
|
+
revealBreakpoint: previousStackFrameWasBreakpointCondition,
|
|
192
|
+
});
|
|
193
|
+
if (link) {
|
|
194
|
+
link.setAttribute('jslog', `${VisualLogging.link('stack-trace').track({click: true})}`);
|
|
195
|
+
link.addEventListener('contextmenu', populateContextMenu.bind(null, link));
|
|
196
|
+
|
|
197
|
+
if (!link.textContent) {
|
|
198
|
+
link.textContent = i18nString(UIStrings.unknownSource);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
stackTraceRows.push({functionName, link});
|
|
202
|
+
previousStackFrameWasBreakpointCondition = [
|
|
203
|
+
SDK.DebuggerModel.COND_BREAKPOINT_SOURCE_URL,
|
|
204
|
+
SDK.DebuggerModel.LOGPOINT_SOURCE_URL,
|
|
205
|
+
].includes(frame.url ?? '');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
buildStackTraceRowsHelper(stackTrace.syncFragment);
|
|
210
|
+
let previousFragment = stackTrace.syncFragment;
|
|
211
|
+
for (const asyncFragment of stackTrace.asyncFragments) {
|
|
212
|
+
if (asyncFragment.frames.length) {
|
|
213
|
+
buildStackTraceRowsHelper(asyncFragment, previousFragment);
|
|
214
|
+
}
|
|
215
|
+
previousFragment = asyncFragment;
|
|
216
|
+
}
|
|
217
|
+
return stackTraceRows;
|
|
218
|
+
}
|
|
219
|
+
|
|
161
220
|
function renderStackTraceTable(
|
|
162
221
|
container: Element, parent: Element,
|
|
163
222
|
stackTraceRows: Array<StackTraceRegularRow|StackTraceAsyncRow>): HTMLElement[] {
|
|
@@ -224,7 +283,9 @@ function renderStackTraceTable(
|
|
|
224
283
|
}
|
|
225
284
|
|
|
226
285
|
export interface Options {
|
|
227
|
-
|
|
286
|
+
// TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
|
|
287
|
+
runtimeStackTrace?: Protocol.Runtime.StackTrace;
|
|
288
|
+
stackTrace?: StackTrace.StackTrace.StackTrace;
|
|
228
289
|
tabStops?: boolean;
|
|
229
290
|
// Whether the width of stack trace preview
|
|
230
291
|
// is constrained to its container or whether
|
|
@@ -269,6 +330,8 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
269
330
|
this.#table = this.contentElement.createChild('table', 'stack-preview-container');
|
|
270
331
|
this.#table.classList.toggle('width-constrained', this.#options.widthConstrained ?? false);
|
|
271
332
|
|
|
333
|
+
this.#options.stackTrace?.addEventListener(StackTrace.StackTrace.Events.UPDATED, this.performUpdate.bind(this));
|
|
334
|
+
|
|
272
335
|
this.performUpdate();
|
|
273
336
|
}
|
|
274
337
|
|
|
@@ -277,10 +340,19 @@ export class StackTracePreviewContent extends UI.Widget.Widget {
|
|
|
277
340
|
return;
|
|
278
341
|
}
|
|
279
342
|
|
|
280
|
-
const {stackTrace, tabStops} = this.#options;
|
|
343
|
+
const {runtimeStackTrace, stackTrace, tabStops} = this.#options;
|
|
344
|
+
|
|
345
|
+
if (stackTrace) {
|
|
346
|
+
const stackTraceRows = buildStackTraceRows(
|
|
347
|
+
stackTrace, this.#target ?? null, this.#linkifier, tabStops, this.#options.showColumnNumber);
|
|
348
|
+
this.#links = renderStackTraceTable(this.#table, this.element, stackTraceRows);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// TODO(crbug.com/456517732): remove when all usages of runtimeStackTrace are migrated.
|
|
281
353
|
const updateCallback = renderStackTraceTable.bind(null, this.#table, this.element);
|
|
282
|
-
const stackTraceRows =
|
|
283
|
-
|
|
354
|
+
const stackTraceRows = buildStackTraceRowsForLegacyRuntimeStackTrace(
|
|
355
|
+
runtimeStackTrace ?? {callFrames: []}, this.#target ?? null, this.#linkifier, tabStops, updateCallback,
|
|
284
356
|
this.#options.showColumnNumber);
|
|
285
357
|
this.#links = renderStackTraceTable(this.#table, this.element, stackTraceRows);
|
|
286
358
|
}
|
|
@@ -12,6 +12,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
12
12
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
13
13
|
import * as Bindings from '../../../../models/bindings/bindings.js';
|
|
14
14
|
import * as Breakpoints from '../../../../models/breakpoints/breakpoints.js';
|
|
15
|
+
import type * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
|
|
15
16
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
16
17
|
import type * as Trace from '../../../../models/trace/trace.js';
|
|
17
18
|
import * as Workspace from '../../../../models/workspace/workspace.js';
|
|
@@ -341,6 +342,53 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
341
342
|
callFrame.url as Platform.DevToolsPath.UrlString, callFrame.lineNumber, linkifyOptions);
|
|
342
343
|
}
|
|
343
344
|
|
|
345
|
+
maybeLinkifyStackTraceFrame(
|
|
346
|
+
target: SDK.Target.Target|null, frame: StackTrace.StackTrace.Frame, options?: LinkifyOptions): HTMLElement|null {
|
|
347
|
+
let fallbackAnchor: HTMLElement|null = null;
|
|
348
|
+
const linkifyURLOptions: LinkifyURLOptions = {
|
|
349
|
+
...options,
|
|
350
|
+
lineNumber: frame.line,
|
|
351
|
+
maxLength: this.maxLength,
|
|
352
|
+
columnNumber: frame.column,
|
|
353
|
+
showColumnNumber: Boolean(options?.showColumnNumber),
|
|
354
|
+
className: options?.className,
|
|
355
|
+
tabStop: options?.tabStop,
|
|
356
|
+
inlineFrameIndex: options?.inlineFrameIndex ?? 0,
|
|
357
|
+
userMetric: options?.userMetric,
|
|
358
|
+
jslogContext: options?.jslogContext || 'script-location',
|
|
359
|
+
omitOrigin: options?.omitOrigin,
|
|
360
|
+
};
|
|
361
|
+
const {className = ''} = linkifyURLOptions;
|
|
362
|
+
if (frame.url) {
|
|
363
|
+
fallbackAnchor = Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, linkifyURLOptions);
|
|
364
|
+
}
|
|
365
|
+
if (!target || target.isDisposed()) {
|
|
366
|
+
return fallbackAnchor;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const createLinkOptions: CreateLinkOptions = {
|
|
370
|
+
tabStop: options?.tabStop,
|
|
371
|
+
jslogContext: 'script-location',
|
|
372
|
+
};
|
|
373
|
+
const {link, linkInfo} = Linkifier.createLink(
|
|
374
|
+
fallbackAnchor?.textContent ? fallbackAnchor.textContent : '', className, createLinkOptions);
|
|
375
|
+
linkInfo.enableDecorator = this.useLinkDecorator;
|
|
376
|
+
linkInfo.fallback = fallbackAnchor;
|
|
377
|
+
linkInfo.userMetric = options?.userMetric;
|
|
378
|
+
|
|
379
|
+
const linkDisplayOptions: LinkDisplayOptions = {
|
|
380
|
+
showColumnNumber: linkifyURLOptions.showColumnNumber ?? false,
|
|
381
|
+
revealBreakpoint: options?.revealBreakpoint,
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const uiLocation = frame.uiSourceCode?.uiLocation(frame.line, frame.column) ?? null;
|
|
385
|
+
this.updateAnchorFromUILocation(link, linkDisplayOptions, uiLocation);
|
|
386
|
+
|
|
387
|
+
const anchors = (this.anchorsByTarget.get(target) as Element[]);
|
|
388
|
+
anchors.push(link);
|
|
389
|
+
return link;
|
|
390
|
+
}
|
|
391
|
+
|
|
344
392
|
linkifyStackTraceTopFrame(target: SDK.Target.Target|null, stackTrace: Protocol.Runtime.StackTrace): HTMLElement {
|
|
345
393
|
console.assert(stackTrace.callFrames.length > 0);
|
|
346
394
|
|
|
@@ -459,6 +507,20 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
459
507
|
return;
|
|
460
508
|
}
|
|
461
509
|
|
|
510
|
+
this.#anchorUpdaters.set(anchor, function(this: Linkifier, anchor: HTMLElement) {
|
|
511
|
+
void this.updateAnchor(anchor, options, liveLocation);
|
|
512
|
+
});
|
|
513
|
+
this.updateAnchorFromUILocation(anchor, options, uiLocation);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
private updateAnchorFromUILocation(
|
|
517
|
+
anchor: HTMLElement, options: LinkDisplayOptions, uiLocation: Workspace.UISourceCode.UILocation|null): void {
|
|
518
|
+
if (!uiLocation) {
|
|
519
|
+
anchor.classList.add('invalid-link');
|
|
520
|
+
anchor.removeAttribute('role');
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
|
|
462
524
|
Linkifier.bindUILocation(anchor, uiLocation);
|
|
463
525
|
if (options.revealBreakpoint) {
|
|
464
526
|
Linkifier.bindBreakpoint(anchor, uiLocation);
|
|
@@ -466,9 +528,6 @@ export class Linkifier extends Common.ObjectWrapper.ObjectWrapper<EventTypes> im
|
|
|
466
528
|
|
|
467
529
|
const text = uiLocation.linkText(true /* skipTrim */, options.showColumnNumber);
|
|
468
530
|
Linkifier.setTrimmedText(anchor, text, this.maxLength);
|
|
469
|
-
this.#anchorUpdaters.set(anchor, function(this: Linkifier, anchor: HTMLElement) {
|
|
470
|
-
void this.updateAnchor(anchor, options, liveLocation);
|
|
471
|
-
});
|
|
472
531
|
|
|
473
532
|
let titleText: string = uiLocation.uiSourceCode.url();
|
|
474
533
|
if (uiLocation.uiSourceCode.mimeType() === 'application/wasm') {
|
|
@@ -809,6 +809,10 @@ export const knownContextValues = new Set([
|
|
|
809
809
|
'column-rule',
|
|
810
810
|
'column-rule-break',
|
|
811
811
|
'column-rule-color',
|
|
812
|
+
'column-rule-edge-end-outset',
|
|
813
|
+
'column-rule-edge-start-outset',
|
|
814
|
+
'column-rule-interior-end-outset',
|
|
815
|
+
'column-rule-interior-start-outset',
|
|
812
816
|
'column-rule-outset',
|
|
813
817
|
'column-rule-style',
|
|
814
818
|
'column-rule-visibility-items',
|
|
@@ -3163,6 +3167,10 @@ export const knownContextValues = new Set([
|
|
|
3163
3167
|
'row-rule',
|
|
3164
3168
|
'row-rule-break',
|
|
3165
3169
|
'row-rule-color',
|
|
3170
|
+
'row-rule-edge-end-outset',
|
|
3171
|
+
'row-rule-edge-start-outset',
|
|
3172
|
+
'row-rule-interior-end-outset',
|
|
3173
|
+
'row-rule-interior-start-outset',
|
|
3166
3174
|
'row-rule-outset',
|
|
3167
3175
|
'row-rule-style',
|
|
3168
3176
|
'row-rule-visibility-items',
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Color Swatch example</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
margin: 0;
|
|
17
|
-
padding: 0;
|
|
18
|
-
}
|
|
19
|
-
#container > li {
|
|
20
|
-
padding: .5rem;
|
|
21
|
-
border: 1px solid;
|
|
22
|
-
margin: 0 .5rem;
|
|
23
|
-
list-style: none;
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
26
|
-
</head>
|
|
27
|
-
<body>
|
|
28
|
-
<ul id="container">
|
|
29
|
-
</ul>
|
|
30
|
-
<script type="module" src="./basic.js"></script>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|